Skip to content

Overhaul Keyboard Functionality (For multiple keyboard layouts, and other functionality) #116

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

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

williamjohnstone
Copy link

@williamjohnstone williamjohnstone commented Jan 30, 2025

This PR is to introduce functionality for different keyboard mappings.

If you would like your mapping to be included in the initial PR, let me know and I will try my best.

Fixes #30

Store is functioning as expected, adding new layouts should be trivial and easily scalable.

Implementation is different for each function that uses the keyboard (PasteModal vs Typing in the WebRTC window) these will all require their own testing.
@williamjohnstone williamjohnstone changed the title [DRAFT] Early implementation of different keyboard layouts. [DRAFT] Add functionality for multiple keyboard layouts Jan 30, 2025
Nevexo added a commit to Nevexo/jetkvm-kvm that referenced this pull request Jan 30, 2025
Alters ActionBar.tsx to make the CTRL+ALT+DEL button in the Action Bar
PR work again with layered with jetkvm#116 - not pulling into the PR
until jetkvm#116 has been integrated, but the my PR will probably just be
dropped anyway.
Nevexo added a commit to Nevexo/jetkvm-kvm that referenced this pull request Jan 30, 2025
@PrinceJunkie
Copy link

PrinceJunkie commented Feb 1, 2025

Please include German Keyboard Layout

…ted settings.tsx to set the keyboard layout properly.
@williamjohnstone williamjohnstone changed the title [DRAFT] Add functionality for multiple keyboard layouts [DRAFT] Overhaul Keyboard Functionality (For multiple keyboard layouts, and other functionality) Feb 2, 2025
@williamjohnstone
Copy link
Author

williamjohnstone commented Feb 2, 2025

I have found further issues with the way that keyboard functionality is implemented, therefor the scope of work on this PR has been expanded.

I am working on this when I have time, thank you for everyone's continued patience.

@williamjohnstone
Copy link
Author

williamjohnstone commented Feb 2, 2025

This PR will now also resolve #125

…teModal to add more clarity to error message. Begin working on key remapping in WebRTC (working to a reasonable degree).
@stylobille
Copy link

Thank you for your help on this, I can test French keyboard if / when needed :)

… my changes (YAY!).

Also spent 4 hours troubleshooting to find out I didn't realise how useCallback works... :/

Anway, not much longer before work on just the mappings can begin.
@Rhaedyr
Copy link

Rhaedyr commented Feb 5, 2025

I know this may have been referenced, but I have a number of Hyprland systems I would love to use the JetKVM for but being able to use win/hyper key without the OS taking over would be immensely helpful, I would be happy to help test if you get to a testing phase, I might also be able to pitch in if I can find the time as well, Good Luck.

Adding an escape sequence in full screen to exit and send all keystrokes in fullscreen mode to the JetKVM might be a solution. say ctrl+alt+esc to exit fullscreen or the overlay exit button and use current system in windowed mode.

@williamjohnstone
Copy link
Author

williamjohnstone commented Feb 6, 2025

I know this may have been referenced, but I have a number of Hyprland systems I would love to use the JetKVM for but being able to use win/hyper key without the OS taking over would be immensely helpful, I would be happy to help test if you get to a testing phase, I might also be able to pitch in if I can find the time as well, Good Luck.

Adding an escape sequence in full screen to exit and send all keystrokes in fullscreen mode to the JetKVM might be a solution. say ctrl+alt+esc to exit fullscreen or the overlay exit button and use current system in windowed mode.

Yes, working on implementing the Keyboard Web API which should resolve this.

the problem is actually getting the browser to capture the keys, by default they are passed straight to the OS and the browser never sees them, which is why currently they don't function

@craxo
Copy link

craxo commented Feb 6, 2025

Please add support for Norwegian Bokmål:
https://kbdlayout.info/KBDNO/

Nevexo added a commit to Nevexo/jetkvm-kvm that referenced this pull request Feb 11, 2025
Alters ActionBar.tsx to make the CTRL+ALT+DEL button in the Action Bar
PR work again with layered with jetkvm#116 - not pulling into the PR
until jetkvm#116 has been integrated, but the my PR will probably just be
dropped anyway.
Nevexo added a commit to Nevexo/jetkvm-kvm that referenced this pull request Feb 11, 2025
Nevexo added a commit to Nevexo/jetkvm-kvm that referenced this pull request Feb 11, 2025
Alters ActionBar.tsx to make the CTRL+ALT+DEL button in the Action Bar
PR work again with layered with jetkvm#116 - not pulling into the PR
until jetkvm#116 has been integrated, but the my PR will probably just be
dropped anyway.
Nevexo added a commit to Nevexo/jetkvm-kvm that referenced this pull request Feb 11, 2025
@CLAassistant
Copy link

CLAassistant commented Feb 13, 2025

CLA assistant check
All committers have signed the CLA.

@williamjohnstone
Copy link
Author

Just wanted to post an update, to let everyone know I haven't abandoned this, just difficult to find the time to work on it currently.

@Nevexo
Copy link
Contributor

Nevexo commented Feb 24, 2025

Just wanted to post an update, to let everyone know I haven't abandoned this, just difficult to find the time to work on it currently.

Never worry about this, we're all incredibly thankful for the time you do spend on it.
Thanks!

…dded functionality to disable keyboard mapping.
@Nevexo
Copy link
Contributor

Nevexo commented Feb 25, 2025

@Nevexo Can you pull these changes into the upcoming jetkvm-next release? I'm keen to get some people testing as I don't have access to different keyboards.

Will do, I'll get it out ASAP.

@timothystewart6
Copy link
Contributor

timothystewart6 commented Feb 26, 2025

@williamjohnstone this does not seem to resolve #125 You mention it here in your comment but I have tested this branch on my own fork and it didn't seem to have any effect on capturing hotkeys. #116 (comment)

@timothystewart6
Copy link
Contributor

Hopped on a call with @williamjohnstone and tested everything.

TLDR; Everything works and it was most likely my cable (3rd party USB C to USB A cable, not the one that ships 🤦)

  • Properly captures Hotkeys (ctrl + ctrl 1-4 and long with ctrl + ctrl arrow keys)
  • Also tested meta keys.
    • Using a mac and sending a commmand key sends the Windows Key
    • Works in both fullscreen and non fullscreen
    • Also works with key combos Windows + R opens run

Thank you!

@netinto
Copy link

netinto commented Mar 4, 2025

Please support Korean Layout.

https://kbdlayout.info/kbdkor

@toxic0berliner
Copy link

Was going to start tinkering when I saw you already did all the hard work, 🙏 thanks 👍
Looking forward to seeing it merged

@n-gerber
Copy link

Thank you very much.
Please add support for the swiss german layout.
Looking forward for it.

@williamjohnstone
Copy link
Author

I will not be adding any further keyboard layouts. Currently have UK, UK (Apple), US, German, and Spanish. It is too time consuming to add every layout and is taking time away from working on functionality. Therefor in the next week or so, I will complete the functionality of my changes, and finalise the Spanish layout. Then I will look to merge. The community can then add their own mappings as this is a trivial process.

I can assist in the mappings if people are having issues, but do not want to dedicate any more time to working on these mappings myself.

@timothystewart6
Copy link
Contributor

I agree. Once this is done it will provide a good pattern for adding more!

@williamjohnstone williamjohnstone changed the title [DRAFT] Overhaul Keyboard Functionality (For multiple keyboard layouts, and other functionality) Overhaul Keyboard Functionality (For multiple keyboard layouts, and other functionality) Apr 12, 2025
@williamjohnstone williamjohnstone marked this pull request as ready for review April 12, 2025 16:11
@williamjohnstone
Copy link
Author

A very short window of time opened up for me this weekend, so I have completed the following:

  • Dropped spanish mappings as they were time consuming to test
  • Dropped Modifier key holding (virtual keyboard) from this PR
  • Dropped addding keyboard mapping setup to initial JetKVM setup.
  • Merged changes with the latest dev branch

I have tested my changes as much as I can today, and briefly reviewed all my code. I believe the PR is now ready for reviewing/merging.

Any issues, let me know.

Thank you :)

@Novido
Copy link

Novido commented Apr 14, 2025

Please add swedish support.
Thank you.

@williamjohnstone
Copy link
Author

Please add swedish support. Thank you. @Novido

I will not be including any additional layouts in this PR.

@williamjohnstone
Copy link
Author

@adamshiervani This is now ready for review

@TerraD
Copy link

TerraD commented Apr 30, 2025

I purchased 3 JetKVM, because they seemed the ideal way to access servers from everywhere – I even intended to purchase some more. However non working keyboard mappings are a dealbreaker!

The keyboard of my notebook is Swissgerman – it's layout is pretty far away from a US keyboard. In fact so far away that any real world usage is nearly impossible. And I can simply not carry a US English keyboard along every day only for that usage... In particular any process where passwords are needed will be practically impossible anyway: as I understand it, this would not even be solved if an US English keyboard would be plugged in. Who would be able to type in a strong password like 'xT<þRÒ%UºÜ|<HtDlïuÖ§Ò5K'`¹çY6º' by means of an US keyboard and the Alt-key?

I would gladly help to supply needed information and testing. However as this problem seems to exist for any non US keyboard I do think there needs to be a global solution that allows for adaptation of foreign keyboards without manual adaptation for each keyboard!

In my opinion this issue is not solved as long as we do not have a solution for all keyboards!

@williamjohnstone
Copy link
Author

@TerraD As far as I know a global solution is not possible. PiKVM also uses keyboard mappings like in this PR. Adding keyboard layouts is trivial and somebody could easily spend time adding most used layouts, I just don't have the time.

@toxic0berliner
Copy link

Keep calm dude you bought into a Kickstarter and open source projet, comments like that feel entitled and are neither productive nor well received I believe.
Thanks William for the work I hope this gets reviewed quickly so other less talented people like myself can start scratching at it to add new and more layouts like FR for my use case 😉

@stylobille
Copy link

stylobille commented Apr 30, 2025 via email

@dlorch
Copy link

dlorch commented Apr 30, 2025

@TerraD As far as I know a global solution is not possible. PiKVM also uses keyboard mappings like in this PR. Adding keyboard layouts is trivial and somebody could easily spend time adding most used layouts, I just don't have the time.

Hi @williamjohnstone, I am happy to volunteer as the contributor, maintainer and tester for the de-CH (Swiss German) keyboard layout. I was able to make frontend and make build_dev your code in my environment.

What's the best way to support? Should I create and provide a ui/src/keyboardMappings/layouts/de_CH.ts to you?

@dlorch
Copy link

dlorch commented Apr 30, 2025

@williamjohnstone apologies, I just saw your earlier note on:

I will not be including any additional layouts in this PR.

Then I will wait for your PR to be merged in an create a new PR for de-CH. Thanks for all your great work on this!

{ value: "en-US", label: "US" },
{ value: "en-GB", label: "UK" },
{ value: "en-GB_apple", label: "UK (Apple)" },
{ value: "de_DE", label: "German (T1)" },
Copy link

Choose a reason for hiding this comment

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

I think this should be value: "de-DE" to match the value in ui/src/keyboardMappings/KeyboardLayouts.ts

@@ -0,0 +1,218 @@
import { keysUKApple, charsUKApple, modifiersUKApple } from './layouts/uk_apple';
Copy link

Choose a reason for hiding this comment

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

Keys and modifiers correspond to definitions in the Linux USB HID gadget driver and are not language-dependent. These definitions could probably be factored out for easier maintenance.

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.

Can't write/paste certain special characters using key combinations