Skip to content

Use DOM codes to identify keys#19

Merged
vxgmichel merged 6 commits intomainfrom
dom-codes
Mar 29, 2026
Merged

Use DOM codes to identify keys#19
vxgmichel merged 6 commits intomainfrom
dom-codes

Conversation

@vxgmichel
Copy link
Copy Markdown
Owner

Specification of DOM keys:
https://www.w3.org/TR/uievents-code/#key-alphanumeric-writing-system

This means gambaterm now uses physical location on the keyboard which do not depend on the current keyboard layout. This allows AZERTY and Bépo users to play without changing their layout.

This means we now use the "base layout key" from the kitty keyboard protocol and scan codes from pynput, which we then translate using the dom_code_data.inc chromium table

@jquast
Copy link
Copy Markdown
Contributor

jquast commented Mar 27, 2026

Very cool, I'm still working on replacing python-prompt-toolkit and the custom kitty keyboard protocol support with my blessed library, I also implemented this "physical location" support there, I was just in the phase of testing and updating the README so I'm glad you're doing the same, I'll rebase my work off of this branch and submit soon

@vxgmichel
Copy link
Copy Markdown
Owner Author

vxgmichel commented Mar 28, 2026

@jquast Thanks, that was quite a rabbit hole.

I also noticed that ghostty and kitty do not report the same alternate keys:

In kitty, when pressing IntlBackslash:

\ PRESS \
CSI 92 :  : 60 ;  ; 92 u
Alternate key: < 

In ghostty:

\ PRESS \
CSI 92 ;  ; 92 u

I think kitty is right in that case. EDIT: I reported it

Also I did not test it on windows and macos, that's why it's not merged yet.

I'll rebase my work off of this branch and submit soon

Awesome. Migrating to blessed was the next item in my todo list, but if you already have something I'll wait for your PR :)

@jquast
Copy link
Copy Markdown
Contributor

jquast commented Mar 28, 2026

I also got slowed down a bit by testing, but so far the blessed transition is looking good, I will rebase and continue testing again soon. I also reported a bugfix, in Contour, and several fixes in the blessed library, so I am glad to see your gambaterm project has been useful for fixing many other projects :)

@vxgmichel
Copy link
Copy Markdown
Owner Author

I also reported a bugfix, contour-terminal/contour#1922

Investigating and fixing race conditions in other's projects?? That's real dedication to open source software :)

I also got slowed down a bit by testing

No hurry, I still have a couple of things to investigate here and there.

@vxgmichel vxgmichel merged commit c86431e into main Mar 29, 2026
8 checks passed
@vxgmichel vxgmichel deleted the dom-codes branch March 29, 2026 01:13
@jquast
Copy link
Copy Markdown
Contributor

jquast commented Mar 29, 2026

And another :) contour-terminal/contour#1924

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.

2 participants