--[Request/Need help implenting]-- I want to add a virtual keyboard interface access button #1164
Replies: 2 comments 3 replies
-
Injecting synthetic key strokes into V86 is possible by sending scancode bus events of type If you only want to send non-alphanumeric keys (Shift, Ctrl, Alt, ESC, F1-F12, etc.) then it's straight forward, because these keys have fixed scancodes (locations) on all keyboards from all countries for decades (unlike the alpanumeric keys like "A", "B", etc.). To find the scancode of a specific key, first see here and here for the KeyboardEvent.code values of the non-alphanumeric keys. Then see Note that in order to inject a full keystroke into V86, you have to send two bus events, one for key-press and another for key-release. The scancode for release is the same as for press but with the most significant bit (0x80) set to 1. Most scancodes are 8 bit, but if a scancode has 16 bits you first send the most significant 8 bit to the bus, then the least significant 8. I've put it all together in Internationalizing Copy and Paste, you should find all you need in my code (specifically keyboard_lib.js, at the bottom EDIT: Fixed outdated infos. |
Beta Was this translation helpful? Give feedback.
-
What do you mean by this? |
Beta Was this translation helpful? Give feedback.
-
I think this would be good for the UI because, while it exists on mobile, not all computers have every key(e.g. pgup, pgdown, home, end, all f-keys). I think this could be a button that adds a separate section(maybe to the right of the running info section).
If you want, I can open a PR for this. I just need to know how to make each button interface with the virtual keyboard. Also, I would like help with making this so it doesn't link into the keyboard inputs unless the user has it toggled on or has pressed the button to turn it on or something.
Beta Was this translation helpful? Give feedback.
All reactions