-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add 'core/input/keyboard' to exports #1998
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
base: master
Are you sure you want to change the base?
Conversation
|
We want to be conservative in what we expose as a stable API. What specifically is it you'd like added? |
|
I need specifically class Beside exporting |
|
The Could you give an example of how you use it? Perhaps a link to the code? |
|
I am using it to forward keyboard events from the whole page: |
|
Hello, a kindly reminder about PR |
|
I'm not sure about what the use case you have here. Is there something preventing the normal method of the noVNC element getting focus and keyboard events the regular way? |
|
I have couple of UI menus that helps user to interact with the remote machine. But after clicking on the menu VNC focus is lost, so I overcome it by setting Keyboard class on the document. |
|
Ah, I see. That is more cleanly supported by simply switching focus back to the RFB object. As an example, we do this in our own application after using some of the buttons on the toolbar: Lines 1702 to 1707 in 44b7489
|
|
That makes sense, but the example designed for the buttons case. I have nested menus with many options, and beside click actions themself there are also cases when user navigated menus and then closed it. Or even when user opened a menu but then decided to type something to the VM. |
|
Don't you want users to be able to navigate the menus using the keyboard? If so, then I don't see any clear way of avoiding having to define specific points where focus is forced back to the RFB object. E.g. whenever a menu item is selected. If you want to make the menus mouse only, then you might be able to get what you want by redirecting the keyboard events as-is. Perhaps something like:
|
|
If the RFB object was a proper shadow DOM, then you could probably have sent the keyboard event directly there. But it's not something we have in place yet. |
|
I've tried to implement such scenarios, but did not non succeeded:
|
|
Having an API to parse keyboard event and send it to VNC really did job great. I could copy-paste class from the Keyboard, it is really simple. But I would prefer to reuse utility classes from noVNC |
Allow noVNC users to use Keyboard utility: it is useful it required to grab events from other then canvas element