-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for mod
key to be dynamic based on Mac/Windows
#715
base: main
Are you sure you want to change the base?
Conversation
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 |
mod
to thedefaultSchema
which will resolve toMeta
on a MacOS like device andControl
on Windows likemod
to be used as a key filter modifier for eithermetaKey
orctrlKey
based on the resolved valuemod
key, and an example to the slideshow pageQuestions
keyMappings
to store themod
resolved value, as this will not be able to be used as a standalone key. Maybe we store it asmod
but then use it askeyup.$mod+s->something#save
for a modifier, but means it can still be used as a single press key viakeyup.mod->something#info
.mod
key at import time? should we make this a function instead? maybe a standalone schema function. Maybe we do something like this...