Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fn 1-12 to toolbar above keyboard to support screen switch #600

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

oxkenshin
Copy link
Contributor

Screenshot 2023-12-15 at 4 55 41 PM

Here is how it looks alike.

This modification made it possible to switch screen from iOS with software keyboard using the shortcut ctrl-shift-alt-fn[1-6].

@@ -356,7 +356,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
keyInputField.text = @"0";
#if !TARGET_OS_TV
// Prepare the toolbar above the keyboard for more options
UIToolbar *customToolbarView = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 44)];
UIToolbar *customToolbarView = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width > 1500 ? self.bounds.size.width : 1500, 44)];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you come up with 1500 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By test :(
Didn't find a solution to calculate the width before drawing. I am not familiar with programing on iOS. Any suggestion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you come up with 1500 here?

New pull request has removed this magic number by correctly calculating the toolbar width. For completeness, it also adds F7-F12 to the toolbar.
The new UI layout also makes the "cross" button on another level to make it always visible.

@oxkenshin
Copy link
Contributor Author

oxkenshin commented Dec 30, 2023

Adds Fn1-Fn12 to Toolbar; Updates UI to make cross button always on top; Improves UI layout algorithm.
Tested on iPad Pro 12.9 inch, and iPad mini 6.

Screenshot 2023-12-30 at 9 33 56 PM
IMG_0072

@oxkenshin oxkenshin changed the title Add fn 1-6 to toolbar above keyboard to support screen switch Add fn 1-12 to toolbar above keyboard to support screen switch Dec 30, 2023
@oxkenshin
Copy link
Contributor Author

Adds arrow key to support shortcuts like Win+Shift+Left/Right Arrow to switch a window to left/right screen.
Screenshot 2023-12-31 at 2 27 00 PM

@knaos
Copy link

knaos commented Mar 22, 2024

This is great and a very needed functionality. I definately need it a lot. Alternatively, can there also be a special button like Next display just for switching the displays? Or a gesture, like three fingers swipe or 4 fingers swipe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants