Replies: 2 comments 3 replies
-
@clauderic, is this something you would consider accepting? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Combing through the discussion and happy to find this discussion has already been started. I have also been looking for some functionality with the alt, shift, and control keys. More specifically the Alt+Shift combination. I have similar code to the proposed setup above in a local fork. @Alaricus, with your proposed changeset, does this also apply to the End (KeyboardSensor.ts: 91) and Cancel(KeyboardSensor.ts: 96) functions? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Good afternoon, everyone!
The default behavior (marking an item for movement with Space of Enter) works fine so long as those keys aren't reassigned to something else. In case each item is a tile or a link, where Space and Enter are used to interact with it, another key can be specified, but it seems like a combination of keys cannot. I'm working on a codebase where we'd like to mark items for movement with Alt+Shift. Currently it doesn't seem possible to do so, because
activators
check against the list of keys like this:keyboardCodes.start.includes(code)
and thekeyboardCodes.start
is an array of strings (KeyboardSensor.ts : 287).I was thinking of making some changes so that
keyboardCodes.start
would contain an array of either strings or objects. If an array element would be an object, it would contain the key (if any) as well as desired statuses for modifies keys. So if the user was to press Q+Alt+Shift, it would look something like this:In turn, the variables that are destructured from the
nativeEvent
(KeyboardSensor.ts : 285) would also includealtKey
,shiftKey
, andctrlKey
, which would be then used to compare against the passed object.Alternatively, arrays could be used instead of objects, so the above could be represented like this:
or, in case where only the modifier keys need to be used, like this:
Is this a type of contribution that the maintainers (and the users) would be interested in seeing?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions