Author Topic: Magic key usage in TMK firmware  (Read 2820 times)

0 Members and 1 Guest are viewing this topic.

Offline bgoodr

  • Thread Starter
  • Posts: 14
Magic key usage in TMK firmware
« on: Wed, 23 November 2016, 11:52:40 »
On my keyboard (see it in https://geekhack.org/index.php?topic=81777.0) I have some how managed to swap the Backspace with backslash. My only guess is that somehow I managed to put it into that mode via the magic key in https://github.com/VinnyCordeiro/tmk_keyboard#boot-magic-configuration---virtual-dip-switch but exactly how that happened confounds me.

So I think that I can reset it by using the same magic key sequence. But I do not know how to actually type the magic key to do anything. For my firmware, I think it is defined as Lshift+Rshift but typing the full sequence of Lshift+Rshift+H does not do anything that I can see (I was expecting that some help text be "typed" out into my text editor I have up but I think maybe that is wrong).

The definition of the magic key that I think is being used is due to this in the config.h file for my keyboard at: https://github.com/VinnyCordeiro/tmk_keyboard/blob/master/keyboard/s60-x/config.h#L47

Thanks,
bg

Current keyboard: Sentraq S60-X 60% DIY Keyboard Kit
Utility I use to build TMK firmware on Ubuntu: Keyboard firmware build utils
Current layout: keymap_spacefn_capslockctrlswap_mousekeys.c

Offline Tactile

  • Posts: 1434
  • Location: Portland, OR
Re: Magic key usage in TMK firmware
« Reply #1 on: Wed, 23 November 2016, 11:56:59 »
I think you must also press the "salt key" - an additional key to avoid accidents.

https://github.com/tmk/tmk_test/blob/master/README.md#boot-magic-configuration---virtual-dip-switch
REΛLFORCE

Offline bgoodr

  • Thread Starter
  • Posts: 14
Re: Magic key usage in TMK firmware
« Reply #2 on: Wed, 23 November 2016, 13:57:11 »
I think you must also press the "salt key" - an additional key to avoid accidents.

https://github.com/tmk/tmk_test/blob/master/README.md#boot-magic-configuration---virtual-dip-switch

Thanks!  When I get my paws on the keyboard again, I will try that.

-bg
Current keyboard: Sentraq S60-X 60% DIY Keyboard Kit
Utility I use to build TMK firmware on Ubuntu: Keyboard firmware build utils
Current layout: keymap_spacefn_capslockctrlswap_mousekeys.c

Offline bgoodr

  • Thread Starter
  • Posts: 14
Re: Magic key usage in TMK firmware
« Reply #3 on: Wed, 23 November 2016, 14:15:58 »
I am still away from the keyboard, but I am reading that  section that reads as follows:

Quote
Boot Magic are executed during boot up time. Press Magic key below then plug in keyboard cable. Note that you must use keys of Layer 0 as Magic keys. These settings are stored in EEPROM so that retain your configure over power cycles.

To avoid configuring accidentally additive salt key KC_SPACE also needs to be pressed along with the following configuration keys. The salt key is configurable in config.h. See common/bootmagic.h.

Specifically this sentence:

Quote
Press Magic key below then plug in keyboard cable

So do I have to press the magic key which is left shift plus right shift in my keyboard's case) plus the salt key, and also then plug in the keyboard?

Or is it the case that I can press the magic key plus the salt key and then the other key (e.g. "h") listed on that page in order to perform the action, without involving the power cable?


Current keyboard: Sentraq S60-X 60% DIY Keyboard Kit
Utility I use to build TMK firmware on Ubuntu: Keyboard firmware build utils
Current layout: keymap_spacefn_capslockctrlswap_mousekeys.c

Offline Tactile

  • Posts: 1434
  • Location: Portland, OR
Re: Magic key usage in TMK firmware
« Reply #4 on: Wed, 23 November 2016, 14:19:12 »
So do I have to press the magic key which is left shift plus right shift in my keyboard's case) plus the salt key, and also then plug in the keyboard?

That's it.
REΛLFORCE

Offline bgoodr

  • Thread Starter
  • Posts: 14
Re: Magic key usage in TMK firmware
« Reply #5 on: Wed, 23 November 2016, 14:27:22 »
Got it.  Thanks!!
Current keyboard: Sentraq S60-X 60% DIY Keyboard Kit
Utility I use to build TMK firmware on Ubuntu: Keyboard firmware build utils
Current layout: keymap_spacefn_capslockctrlswap_mousekeys.c

Offline bgoodr

  • Thread Starter
  • Posts: 14
Re: Magic key usage in TMK firmware
« Reply #6 on: Sun, 27 November 2016, 20:52:23 »
I confirmed that this works. The Backslash and Backspace are now put back in their correct mappings!

So in summary, I had to do all of these things:

  • Unplug USB cable
  • Hold down Lshift, Rshift, Spacebar, Backspace
  • Plug in USB cable
  • Release all keys

Note I had to hold down Backspace in this case because the keyboard had somehow gotten backslash and backspace swapped, so the Backspace key really was the the Backslash key.

How this keyboard got into that mode is still quite baffling, because it was very difficult to hold all of those keys down and plug in the USB cable at the same time.

So this proves that the default magic key is LShift + RShift.

So thanks for the help!
Current keyboard: Sentraq S60-X 60% DIY Keyboard Kit
Utility I use to build TMK firmware on Ubuntu: Keyboard firmware build utils
Current layout: keymap_spacefn_capslockctrlswap_mousekeys.c

Offline Tactile

  • Posts: 1434
  • Location: Portland, OR
Re: Magic key usage in TMK firmware
« Reply #7 on: Sun, 27 November 2016, 20:58:22 »
I confirmed that this works. The Backslash and Backspace are now put back in their correct mappings!

So in summary, I had to do all of these things:

  • Unplug USB cable
  • Hold down Lshift, Rshift, Spacebar, Backspace
  • Plug in USB cable
  • Release all keys

Note I had to hold down Backspace in this case because the keyboard had somehow gotten backslash and backspace swapped, so the Backspace key really was the the Backslash key.

How this keyboard got into that mode is still quite baffling, because it was very difficult to hold all of those keys down and plug in the USB cable at the same time.

So this proves that the default magic key is LShift + RShift.

So thanks for the help!

Well, I guess it's a good design 'cause there's no chance of doing that accidentally. I'm happy it worked for you.
REΛLFORCE

Offline hasu

  • Posts: 3474
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Magic key usage in TMK firmware
« Reply #8 on: Sun, 27 November 2016, 21:18:42 »
I confirmed that this works. The Backslash and Backspace are now put back in their correct mappings!

So in summary, I had to do all of these things:

  • Unplug USB cable
  • Hold down Lshift, Rshift, Spacebar, Backspace
  • Plug in USB cable
  • Release all keys

Note I had to hold down Backspace in this case because the keyboard had somehow gotten backslash and backspace swapped, so the Backspace key really was the the Backslash key.

How this keyboard got into that mode is still quite baffling, because it was very difficult to hold all of those keys down and plug in the USB cable at the same time.

So this proves that the default magic key is LShift + RShift.

So thanks for the help!


By default configuration 'boot magic/salt key' is space and 'magic key' is LSfhit+RShift, iirc. So you don't need to press Shift keys, just space is needed for boot magic.
With wrong matrix wiring, open or unstable I/O pins boot magic setting is likely to confgured unexpectedly, you will have to disable boot magic with unfinished hardware.


Offline bgoodr

  • Thread Starter
  • Posts: 14
Re: Magic key usage in TMK firmware
« Reply #9 on: Sun, 04 December 2016, 21:25:32 »
By default configuration 'boot magic/salt key' is space and 'magic key' is LSfhit+RShift, iirc. So you don't need to press Shift keys, just space is needed for boot magic.

Ok thanks. I wondered about my use of the space key. One thing I have to consider is that, in my keyboard, I have enabled SpaceFN in my keyboards layer mapping:

https://github.com/bgoodr/keyboard-firmware-build-util/blob/master/s60-x/keymap_spacefn_hjklarrow_capslockctrlswap_mousekeys_functionkeys.c#L28

With wrong matrix wiring, open or unstable I/O pins boot magic setting is likely to confgured unexpectedly, you will have to disable boot magic with unfinished hardware.

I'm not sure I know what "unfinished hardware" is in this case since all of the hardware is complete in the sense that everything is completely soldered (well, unless I messed up the soldering which might be a possibility somewhere).

Current keyboard: Sentraq S60-X 60% DIY Keyboard Kit
Utility I use to build TMK firmware on Ubuntu: Keyboard firmware build utils
Current layout: keymap_spacefn_capslockctrlswap_mousekeys.c