rendajs / Renda

A modern rendering engine for the web.
https://rendajs.org
MIT License
10 stars 4 forks source link

Support for remapping modifier keys #576

Open jespertheend opened 1 year ago

jespertheend commented 1 year ago

On linux I have xmodmap configured to swap control and command, all applications respect this preference, but chrome for some reason browsers still report this key as 'ControlLeft' and 'OSLeft'. It seems like the ctrlKey and metaKey properties on keyboard events do respect this preference though, so those should probably be used instead.

jespertheend commented 1 year ago

Interesting to note: Firefox does not seem to set metaKey to true on linux, it does on OS X.

jespertheend commented 1 year ago

modifier keys, and xmodmap in general is a big mess. See https://crbug.com/1076544 I don't think this is a bug in Renda Studio, but rather, a bug in browsers. I think the best solution here is to allow users to configure their modifier keys using preferences. We can't expect the user to remap all shortcuts containing the Ctrl key for instance.

jespertheend commented 1 year ago

Fwiw, keyd seems like a good replacement for xmodmap that does not run into this issue. See https://superuser.com/a/1790598/594545