Javascript keyboard mapping on non evdev X11 systems

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
abszero
New to the forum
New to the forum
Posts: 1
Joined: 2026-01-20, 20:18

Javascript keyboard mapping on non evdev X11 systems

Post by abszero » 2026-01-21, 09:44

I noticed that the some key mappings in javascript were wrong for NetBSD under Firefox, Palemoon and most browsers (but interestingly not librewolf)

The easiest way to confirm the issue would be to go to https://keyjs.dev/ while running Palemoon on NetBSD and see "odd" e.code values for the arrow keys.

I mainly noticed as it broke the arrow keys in the web UI of proxmox and ESXi on Firefox (which made setting adjusting VM BIOS settings impossible)

More details in a thread on a NetBSD list https://mail-index.netbsd.org/current-u ... 47199.html

It looks like the X11 key mappings are set for evdev systems (Linux & FreeBSD)

I've run up a patch which I'm running locally in palemoon which should only affect NetBSD builds (attached). I suspect OpenBSD may be affected, but I don't have a system easily to hand to test (and running remotely from a VM to a different OS does not show the issue)

Patch originally against 39.0.1, but just retested against 34 :)

What do people think?
You do not have the required permissions to view the files attached to this post.

User avatar
mittorn
Hobby Astronomer
Hobby Astronomer
Posts: 19
Joined: 2026-01-13, 19:32

Re: Javascript keyboard mapping on non evdev X11 systems

Post by mittorn » 2026-01-28, 22:00

New codes mosly match x11 branch. Maybe it's better to only override different lines?
And how it work on non-x11 linux systems?
I have not implemented e.code/e.key for SDL, but existing macro include does not look very useful for it

User avatar
mittorn
Hobby Astronomer
Hobby Astronomer
Posts: 19
Joined: 2026-01-13, 19:32

Re: Javascript keyboard mapping on non evdev X11 systems

Post by mittorn » 2026-01-28, 22:11

keyjs.dev caused this bug in my debug build:
https://bugzilla.mozilla.org/show_bug.cgi?id=1159285
And same time it does not reproduce on different profile.
It was fixed here:
https://hg-edge.mozilla.org/releases/mo ... 82d0c33427

User avatar
Moonchild
Project founder
Project founder
Posts: 38816
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Javascript keyboard mapping on non evdev X11 systems

Post by Moonchild » 2026-01-28, 22:20

mittorn wrote:
2026-01-28, 22:11
keyjs.dev caused this bug in my debug build:
https://bugzilla.mozilla.org/show_bug.cgi?id=1159285
And same time it does not reproduce on different profile.
It was fixed here:
https://hg-edge.mozilla.org/releases/mo ... 82d0c33427
Patches welcome!
"There is no point in arguing with an idiot, because then you're both idiots." - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Moonchild
Project founder
Project founder
Posts: 38816
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Javascript keyboard mapping on non evdev X11 systems

Post by Moonchild » 2026-01-28, 22:49

Filed Issue #2922 (UXP) for the OP issue.
"There is no point in arguing with an idiot, because then you're both idiots." - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite