Author Topic: TMK keymap question about ACTION_LAYER_TAP_KEY feature?  (Read 1077 times)

0 Members and 1 Guest are viewing this topic.

Offline OfTheWild

  • * Esteemed Elder
  • Thread Starter
  • Posts: 1297
  • Location: Cary, NC
  • Make things. Have fun.
    • Studios of the Wild
TMK keymap question about ACTION_LAYER_TAP_KEY feature?
« on: Wed, 27 July 2016, 15:22:46 »
I'm trying to get my keymap built (still having issues compiling on win10 but thats another issues) and i'm reading matt3o's tutorial and wondered if theres a way to setup the "Fn" key to opperate the numlock function layer via the TAP feature? I'm not sure if that makes sense so i'll describe what i want:

HOLD Fn key = F0 layer keymap
TAP Fn key = num lock=on
...able to use numpad overlay with "789uiojklm." like on a realforce
TAP Fn key again to turn numlock=off

example code from Hasu using ESC key input on TAP, Fn key on hold:
Code: [Select]
const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_MOMENTARY(1),
  [1] = ACTION_LAYER_TAP_KEY(1, KC_ESC),
  [2] = ACTION_LAYER_TOGGLE(2)
};

Is this doable/Been done? Is this stupid?
-Dana

Online suicidal_orange

  • * Global Moderator
  • Posts: 3856
  • Location: England
Re: TMK keymap question about ACTION_LAYER_TAP_KEY feature?
« Reply #1 on: Wed, 27 July 2016, 15:51:03 »
Sounds perfectly reasonable to me, but you don't actually want it to be number lock as you need to swap the keys from those letters to numbers - it will be like another FN.  Something like this where layer 3 has the numbers mapped?

Code: [Select]
const uint16_t PROGMEM fn_actions[] = {
  [0] = ACTION_LAYER_MOMENTARY(1),
  [1] = ACTION_LAYER_TAP_KEY(1, ACTION_LAYER_TOGGLE(3),
  [2] = ACTION_LAYER_TOGGLE(2)
};

You'll need to set numberlock elsewhere if you want/need real numberpad keycodes, if you don't need them you can just use the top row number codes and not worry about real number lock :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod
MX Brown 30g, HHKBish
Vortex OEM PBT
for See how the other half lives challenge!

Offline OfTheWild

  • * Esteemed Elder
  • Thread Starter
  • Posts: 1297
  • Location: Cary, NC
  • Make things. Have fun.
    • Studios of the Wild
Re: TMK keymap question about ACTION_LAYER_TAP_KEY feature?
« Reply #2 on: Wed, 27 July 2016, 16:24:02 »
ok so yeah then just on layer3 function i'd just map the tenkey layout from what realforce does when the numlock key is toggled? Makes sense. Thanks, i will try that (and try to get winavr working for compiling this into a hex file)
-Dana