feat(Hardware Support): Razer Tartarus Pro#518
Draft
dripsnek wants to merge 4 commits intoShadowBlip:mainfrom
Draft
feat(Hardware Support): Razer Tartarus Pro#518dripsnek wants to merge 4 commits intoShadowBlip:mainfrom
dripsnek wants to merge 4 commits intoShadowBlip:mainfrom
Conversation
… and analog mode are not yet working.
…or variable actuation points, dual binding, retrigger and continuous retrigger. Does not currently emit key events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This WIP PR implements support for the Razer Tartarus Pro gaming keypad. To date I've not found anything which allows usage of the analog mode specific to this model under Linux. This aims to resolve that gap.
For the time being it is a tech demo; Basic mode support (barring the scroll wheel #514) is fully implemented but InputPlumber was not needed for that anyway. The analog event handler is implemented but its configuration is hard coded and does not emit to the main event vector, just prints to the log when it would. I think this device is the first of its kind for InputPlumber and how to represent that from a profile perspective in my mind is the major piece of work to go.
This implementation takes full control of the hidraw (x3) and evdev nodes (x4) but passes through the last endpoint allowing lighting control software e.g. OpenRGB to manage the RGB functions whilst InputPlumber is running. The specifics of each endpoint and report type are worth discussing elsewhere.
By default the Tartarus Pro powers up into a basic mode which acts as the left side of a QWERTY keyboard, plus the directional keys and a mouse scroll wheel. Analog mode is opt-in at runtime by sending a specific HID feature report.
The need for a driver exists because analog mode generates vendor defined HID reports that contain the positional value of each key instead of events. These must be processed and mapped to input events and this seemed like a natural fit for InputPlumber to handle.
The analog event handler is implemented using simple linear regressions on a small buffer* to drive a per-key state machine and supports the following:
* The buffer depth of 5 was based on protocol analysis of fast key transitions from the device
** Not intended to operate simultaneously with retrigger
*** AKA Rapid Trigger which seems to be trademarked?
Regarding device profiles, to support analog mode each key mapping would also need to include:
Out of scope topics:
Other topics influencing implementation:
The Tartarus Pro includes a button and a set of 3 fixed LEDs (separate to RGB registers) to notionally support runtime switching of profiles with the LEDs indicating the active one, hence a 'limit' of 8 profiles. Like most other features on this gamepad it is entirely implemented in software and the button can be remapped like any other. This raises the question of whether InputPlumber intends to support this mode and how this could be agnostically represented in a profile, maybe as a 'flair' type?
Like a lot of products in this class it is possible to acquire the serial number, firmware revision and other such data from the device registers. This could be used to uniquely assign profiles to a specific device or implement quirks for a given firmware. Should this be incorporated?
The Tartarus Pro is a left-handed device but someone, somewhere will somehow find a way to use 2 of them. Should we embrace this or defend against it?
I think these need to happen before removing WIP: