Razer Tartarus V2 (1/2 keyboard for gamers with some extra controls) as button pad?

I have a Razer Tartarus V2 keypad kicking around doing nothing:

image

I’m curious if all of the functions of the 20 buttons on the V5 are assignable to the CUIA interface? Likewise, it’s got RGB backlight, how difficult would it be to have them light up properly? What language(s) would one need fluency (or at least, a willingness to work their arse off) in to handle that? Perhaps there’s a driver for a similar device that an astute recognizer of patterns might be able to learn something by looking at?

1 Like

You should be able to map the buttons off the USB keypad to the same functions that the Z5 buttons trigger or you can map them to trigger the actual buttons which gives you the same short/bold/long press behaviour. (I don’t recall whether that functionality is in stable or testing.)

Regarding LED feedback - you will need to figure out how to drive the LEDs. That may be the biggest challenge. Adding something to Zynthian to trigger this requires some Python coding.

https://openrazer.github.io/ might be what you want.

1 Like

I’m pretty handy with Python, if I get around to this I’ll probably request a bit more direction about repo to investigate etc. :>

1 Like

And what about this ?

image

each button has its own 0.85inch display + RGB led

It’s quiet expensive (73$) LILYGO T-Keyboard-S3 ESP32-S3

Uh, this is giving me ideas :bulb:
Right next time I have some spare time, so… 2025😄

1 Like

Hi there,

I’d like to revive this conversation. I have a few usb game pads sitting around and I’d like to use them to control navigation, bold press, select, back, etc on zynthian.

Where would I go to register the key presses? Is this done in the terminal, prefs or webpage?

My setup just has a touch screen (no hardware buttons or encoders) and it would be nice to not have the v5 controls on the screen

1 Like

Hi @trojanGoat,

I have been successful in using two models of the excellent Romoral Store keypads (on AliExpress), with custom Zynthian builds.

I order to achieve this, you have to link the keypress evoked by each key of your gaming pad (which should be customisable, by the way) to a specific Zynthian function of the GUI.

This is doable in Webconf > UI options > UI keybinding. You will see a comprehensive drop-down menu of functions, screens and operations, aside their definitions as actions triggered by the pressure of specific qwerty keys, or combination thereof.

I hope it helps. Good luck with your Tartarus!

Best regards :rainbow:

1 Like

Hi @Aethermind,

Do you perhaps (or does anyone else) know where the keys are linked to scan codes?

I have a keypad with an extra row of keys that are marked home, tab, mail and calculator. The corresponding scancodes (according to showkey ) are 172, 15, 155 and 140. These should be the keys for BrowserHome, tab, LaunchMail and LaunchApp2 but only tab is recognized.

I suppose there is a table hidden somewhere to link key descriptions to scancodes, but I haven’t found it yet.

Kind regards,

Hans.

@HansR we use tkinter’s keycodes. The configuration in webconf does have learn so you could try plugging the keypad into the PC running webconf and try capturing the keys.

1 Like

@riban I see learn on top of the Keyboard Binding screen but it is greyed out (not clickable).

Is that the right place?

1 Like

The web interface is suboptimal. If the box is blue (as shown in your capture) then it is learning. YOu should see the key and modifiers update as you press keys.

[Edit] You may find that the OS hosting the web browser captures and reacts to the keys before passing on to the web browser.

1 Like

I think I understand why it doesn’t work. The keys I mentioned are not known by the webconf.

I can’t find a list of tkinter’s keycodes, so I’ll leave it for now. It’s not important.

Same here. I just want to use the arrow keys and a few buttons to control zynthian but I’m not really getting any feedback.

Hi @HansR and @trojanGoat ,

I am sure that there must be other routes, for achieving keybinding from an external keypad or keyboard. I can only comment on the rather well-thought UI Keybinding tab of the webconf > UI options menu.

For every Zynthian UI action, screen or function (from an extensive drop-down menu) you can define a corresponding external trigger key, selecting it from another drop-down menu. Please, be aware that there is already a complete keybinding layout for a qwerty keyboard, so you’ll have to override (modify) or delete altogether certain key assignments, if you want to use a specific layout for a specific keypad.

The other half of the trick, if your keypad has (like many on the market) its own key-to-character configuration app, is to set up the keypad layout before linking it to the Z functions, with the keybinding window.

At least, this is the only workflow I really know. :slight_smile:

The python code for keymapping is in zynthian_ui/zyngui/zynthian_gui_keybinding.py. It contains lists of known keycode / key name mapping. I don’t have a keyboard with the keys described above so can’t easily detect their codes. They are likely to fail via VNC because the hosting OS will intercept and react to them. The binding is held in a file /zynthian/config/keybinding.json that relies on the names of the keys, not their scan codes or key codes. (That may seem odd but there was a reason that made sense at the time.) So, the current codebase does not support non-standard or esoteric keys. (Yeah - I know these are probably standard and widely available!) I think the issue I had with using scan codes is that they only represent the position of physical keys, not what the keytop shows, making them difficult to represent to multiple users with different keyboard layouts in different languages. Similarly with keycodes, they can be inconsistent. So I used the tkinter key names. Maybe there is room for improvement but this is a small usecase so quite low in the priorities. If someone wants to put in the effort to refactor this, ensuring it works for everyone in the world then great!!! :smile:

3 Likes

There is a comment in the code specifically stating that the required keybindings are unsupported. I think this is because the layer at which we access the keybinding within tkinter does not support these keys. It is possible to access the keyboard at a lower level but you must then do all the mapping of scan codes based on user configuration and physical keyboard which we seek to avoid. ChatGPT says:

The BrowserHome key is part of a group of special media or browser keys found on some extended keyboards (e.g. with buttons like Home, Search, Refresh, Favorites, etc.). Unfortunately, Tkinter does not natively support all of these special keys, because it is built on top of Tcl/Tk, which relies on the underlying OS and windowing system for key event recognition.

2 Likes

Thanks @Aethermind and @riban.

I already put this aside as “not worth the trouble”.

I value a standard implementation too much to make these kinds of changes to it.

Perhaps a scancode translator like setkeycodes works, but at the moment I have other fish to fry.

Kind regards,

Hans.

2 Likes