clockworkpi

Binding LK3 to Pause Game in Retroarch. Is it possible?

Is it possible to bind the useless LightKey middle button to Pause Game in retroarch?
I tried binding it in Retroarch directly but it seems that I can’t bind anything in there, this must be another GREAT effect of this OS v.04…

So, in retroarch.cfg, how can I achieve that exactly.

Thanks

I don’t think you could bind it in 0.3 or earlier. From my understanding, LK3 acts as a duplicate shift key.

On that note, LK1, 2, 4 and 5 can all be achieved by pushing shift and ABXY. It’s more of a convenience thing. I’ve actually taken to not using it, preferring clean lines and a streamlined system.

It may be possible to reprogram the arduino board, removing use of the shift key altogether. You would only be missing out on the + / - keybinding, which is usually for volume control. But with the universal hotkey to control brightness and volume using select and the D-pad, it becomes redundant.

In short, you could map shift to either + or -, and map that key to whatever you want.

I haven’t checked it, but I assume that LK3 is potentially hardwired to be the same key as whatever shift is, so you would need to have this duplicated.

I read in another thread that LK3 binds to the Shift key on a keyboard and is not a duplicate of the Shift functionality, but I don’t know if that’s actually true.

Yup, just like the shift key on the Gameshell’s fascia inputs.
However, it’s not a shift key in the same sense that shift is a mappable key. It’s more like a laptop’s fn key that doesn’t serve any purpose by itself, but rather a modifier for existing keys.
I haven’t read anything about it not being a modifier, but I could be mistaken! Link it if you find it! I’m curious to read into this.
When you hold LK3 and push ABXY, it gives the same output as if you were pushing the face key shift key and ABXY; ie it outputs the L/R/L2/R2 keys.
Either way, you should be able to program it to be whatever you want flashing the arduino firmware.

GS Shift maps to Keyboard nul
and GS LK3 maps to Keyboard shift.

But I think it wasn’t coded in the keypad so its basically unused.

EDIT: yep https://github.com/clockworkpi/Keypad/blob/9935fdc40d0389c4c6ad25a9aeb516cfb3a28f70/clockworkpi_keypad.ino#L45

So it does mimmick the front shift after all?

I think it shouldn’t do anything as its not mapped.

in the code it is not mapped as an output “keyboard” key but tested like the “real” shift key :

const int shift_pins[SHIFT_KEY_NUM] = {1, 5}; // 5 is LK3
...
bool shift_key_pressed()
  for(int i = 0; i < SHIFT_KEY_NUM; i++)
    if(analogRead(shift_pins[i]) /ADC_BOUNDARY == KEY_ON)
      return true;
...
key = shift_key_pressed() ? shift_keys[i] : keys[i];
1 Like

Lol hardcoded functionality!

So then, just remove it from shift pins and define it as a keyboard and then it could be defined for something else.

Ok… so how would you go about doing that?

A quick look:

#define SHIFT_KEY_NUM 1

const int pins[KEY_NUM] = {3,  6, 7, 8, 9, 10, 11, 12, 13, 0, 2, 3, 4,5, 6, 7};
const int shift_pins[SHIFT_KEY_NUM] = 1;

And a couple of more places like
#define KEYPAD_LIGHT3 HERE_THE_KBKEY_YOU_WANT

const int keys[KEY_NUM] = 
{
  KEYPAD_UP, KEYPAD_LEFT, KEYPAD_DOWN, KEYPAD_RIGHT, KEYPAD_Y, KEYPAD_X, KEYPAD_A, KEYPAD_B, KEYPAD_START, 
  KEYPAD_MENU, KEYPAD_SELECT, KEYPAD_LIGHT1, KEYPAD_LIGHT2,KEYPAD_LIGHT2, KEYPAD_LIGHT4, KEYPAD_LIGHT5
};

Unfortunately I dont have a light key to test it, but thats the changes in a nutshell, it shouldn’t take much more changes appart from that.

3 Likes

Thanks :slight_smile:
And where is this .ino file hidden?

In the github repository :joy: That file is compiled to a hex file and burned into the atmega microcontroller of the keypad.

Oh I need to flash it.
Ok I’ll play with this this weekend. :slight_smile:
Thanks