Skip to content
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

ACTION_MODS_KEY does not send modifier from KEYMAP #184

Closed
technomancy opened this issue Feb 8, 2015 · 3 comments
Closed

ACTION_MODS_KEY does not send modifier from KEYMAP #184

technomancy opened this issue Feb 8, 2015 · 3 comments

Comments

@technomancy
Copy link

I'm trying to use ACTION_MODS_KEY to send shifted keycodes. In keymap.md it says you can use ACTION_MODS_KEY(MOD_LSFT, KC_1) to send a shifted 1, or !. However, when I bind this to a key inside the keymaps[] array, it just sends 1.

  KEYMAP(SHIFT(KC_1), SHIFT(KC_2), SHIFT(KC_MINS), SHIFT(KC_EQUAL), SHIFT(KC_BSLS), ...)

I have changed the KEYMAP macro to use a 16-bit value instead of an 8-bit one as the documentation indicates is necessary.

I have this working using ACTION_MODS_KEY in the fn_actions array, but it's far too tedious. I need to be able to declare it inline in the keymap since I have layers that are mostly shifted keycodes. Having to declare every shifted keycode once in the keymap and once in fn_actions (and trying to keep the references straight when I change them) is error-prone.

Is this supposed to be supported in KEYMAP or only inside fn_actions?

@technomancy technomancy changed the title ACTION_MODS_KEY does not send modifier. ACTION_MODS_KEY does not send modifier from KEYMAP Feb 8, 2015
@tmk
Copy link
Owner

tmk commented Feb 8, 2015

To use action directly like that you will have to implemnt action_t action_for_key(uint8_t layer, keypos_t key) youself Intead of using keymap.c. The function should convert key event to action, keymap.c uses user defined keymaps to convert. Your version of the function should use actionmaps(16bit map) instead of 8bit keymap.

@technomancy
Copy link
Author

Thanks; I've got this working in 2f7b588, but not cleanly; I just ripped out a bunch of code I'm not using to make it function.

I would love it if this were possible to do in the mainline TMK codebase and was considering submitting a pull request with this done the Right Way. But I get the feeling that there's a reason it's not supported currently. Is it just a reluctance to use 16 bits in order to make the layer definitions more compact in memory?

@tmk tmk closed this as completed Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants