x-spreadsheet Key maps should be different between operating systems.

k3bvogb1  于 2022-12-31  发布在  其他
关注(0)|答案(1)|浏览(274)

In Windows, ctrl works as the fn key, but in macOS, command works as the fn key in general.

There are some awesome libraries out there could make this easy:
ccampbell/mousetrap: https://github.com/ccampbell/mousetrap
madrobby/keymaster: https://github.com/madrobby/keymaster

izj3ouym

izj3ouym1#

After some digging on the source codes, I'd think that the key binding logic could be split into a separate module for long term implementation and optimization:

  1. For new functions/features will be added, it could be easily adopted to binding into some new key definitions.
  2. For some common use cases like for mobile/touch devices, key bindings can be auto disabled.
  3. Maybe in some cases, people would want to disable the key bindings manually.
  4. Maybe in some cases, people would like to bind different keys to some functions/features rather than the defaults.

And splitting these codes into a separate module can definitely makes the codes more readable, maintainable and extensible.

相关问题