Skip to content

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

Open
oxkenshin wants to merge 5 commits into
moonlight-stream:masterfrom
oxkenshin:master
Open

Add fn 1-12 to toolbar above keyboard to support screen switch#600
oxkenshin wants to merge 5 commits into
moonlight-stream:masterfrom
oxkenshin:master

Conversation

@oxkenshin

Copy link
Copy Markdown
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].

Comment thread Limelight/Input/StreamView.m Outdated
#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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

oxkenshin commented Dec 30, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

knaos commented Mar 22, 2024

Copy link
Copy Markdown

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?

@medicalwei

Copy link
Copy Markdown

Am looking for this to be merged, as iPad keyboard case does not have Fn keys and I need it for my use case.

What criteria are needed for verification?

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.

4 participants