Add support for mod key to be dynamic based on Mac/Windows#715
Add support for mod key to be dynamic based on Mac/Windows#715lb- wants to merge 1 commit intohotwired:mainfrom
mod key to be dynamic based on Mac/Windows#715Conversation
| It appears that the CI is running as non-Mac but when running Chrome headless locally it runs as mac potentially. I will have to review this PR a bit later and see if I can find a better way to test this feature in unit tests. |
cd03c7e to 9f433fb Compare | Have adjusted the tests to provide better coverage of the different platforms, added some more tests and ensure the CI passes. I have also added some questions about this PR to check the approach taken. |
9f433fb to 6b3291c Compare | Here is a branch comparison with one of the different approaches described above, instead of This approach will give a bit more control to any overrides of the schema and avoids confusion where It does not solve for existing schema |
| Hey @marcoroth - hope it's ok to ping, just wondering if this could be reviewed. Thank you. |
- Adds `mod` to the `defaultSchema` which will resolve to `Meta` on a MacOS like device and `Control` on Windows like - Uses `mod` to be used as a key filter modifier for either `metaKey` or `ctrlKey` based on the resolved value - Add unit tests and documentation for the `mod` key, and an example to the slideshow page - Closes hotwired#654
6b3291c to b59ab24 Compare | Just rebased |
modto thedefaultSchemawhich will resolve toMetaon a MacOS like device andControlon Windows likemodto be used as a key filter modifier for eithermetaKeyorctrlKeybased on the resolved valuemodkey, and an example to the slideshow pageQuestions
keyMappingsto store themodresolved value, as this will not be able to be used as a standalone key. Maybe we store it asmodbut then use it askeyup.$mod+s->something#savefor a modifier, but means it can still be used as a single press key viakeyup.mod->something#info.modkey at import time? should we make this a function instead? maybe a standalone schema function. Maybe we do something like this...