qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
17.8k stars 38.15k forks source link

Sequence tirggers function #91

Closed 20lives closed 8 years ago

20lives commented 8 years ago

is it possible to send a keypress after a sequence? for example for a dvorak user who wants to keep the qwerty CTRL functions (copy, cut, find...) locations like LCTL(KC_K) will result in LCTL(KC_C).

same thing needed in the Symbol Layer in the default map of the Ergodox_EZ, how can I activate the ctrl shortcuts on a layer who run over the needed keys (c,v,a,f)

i can't find this feature in the docs.

jackhumbert commented 8 years ago

I'm not sure what you mean by sequence, but you can use the Dvorak-specific keycodes like DV_C to get a literal C when the OS is set to Dvorak. You'll need to include keymap_dvorak.h at the top of your keymap. On Sat, Jan 16, 2016 at 7:05 AM, 20lives notifications@github.com wrote:

is it possible to send a keypress after a sequence? for example for a dvorak user who wants to keep the qwerty CTRL functions (copy, cut) locations like LCTL(KC_K) will result in LCTL(KC_C)

i can't find this feature in the docs

— Reply to this email directly or view it on GitHub https://github.com/jackhumbert/qmk_firmware/issues/91.

20lives commented 8 years ago

read my other example.

i have to use os qwerty

20lives commented 8 years ago

in kiibohd/KLL the feature available, you can read it in the spec http://input.club/kll.

jackhumbert commented 8 years ago

I'm still not sure exactly what you're talking about, but if you're looking for a qwerty-ctrl key when your default layout is hard-coded dvorak, a macro like this would work:

if (record->event.pressed) {
  register_code(KC_LCTL);
  layer_state |= (1<<5);
} else {
  unregister_code(KC_LCTL);
  layer_state &= ~(1<<5);
}

Where layer 5 is the qwerty keymap of the control keys you're talking about, and your control key is M(x) (x being the macro number you place this code block into).

eltang commented 8 years ago

Do you mind having to do execute all of your shortcuts in QWERTY? If not, here is a solution. You should change layer 1 to be a QWERTY layer. Then you should change the Ctrl keys on your Dvorak layer to function keys that use ACTION_LAYER_MODS(1, MOD_LCTL).

jackhumbert commented 8 years ago

I believe that's what they're talking about - the macro I wrote does the same thing.

eltang commented 8 years ago

I see that now. Do you know if there is some file in which I can find the macros that correspond to each action?

jackhumbert commented 8 years ago

Unfortunately macros are implemented in a different way than the actions - action.c contains a lot of them.

eltang commented 8 years ago

Oh. I was hoping I could find a solution to the problem I posted in your subreddit. Do you have any ideas?