Conversation
| "<SA-ArrowUp><SA-ArrowUp><SA-ArrowDown><SA-ArrowDown><SA-ArrowLeft><SA-ArrowRight><SA-ArrowLeft><SA-ArrowRight>ba": | ||
| "open https://www.youtube.com/watch?v=M3iOROuTuMA", | ||
| // Mappings for an xbox 360 controller | ||
| "<G-0>": "fillcmdline", // A button |
There was a problem hiding this comment.
| "<G-0>": "fillcmdline", // A button | |
| "<G-0>": "fillcmdline_notrail", // A button |
As [bovine3dom said on matrix](https://matrix.to/#/!xmubtggllUtLrQiGyn:matrix.org/$1566330020150744QfSIq:matrix.org?via=matrix.org&via=arcn.mx&via=yuri.im), Tridactyl needs gamepad support in order to expand and be able to reach new users. This is the first step on the road to Tridactyl becoming the true google-stadia enabled, gamer-oriented, billion-dollars making service as a software it can be.
0a4c04f to
d342a48
Compare
|
I can't quite believe that the D-Pad isn't supported. It seems like it wouldn't be a very useful API with it. Rather than asking people to guess which number is which button, might we use a library such as https://github.com/samiare/Controller.js? If the polling hurts performance we can just gate it behind a setting (or perhaps check for |
There does seem to be two |
| @@ -52,10 +55,26 @@ export class MinimalKey { | |||
| /** Does this key match a given MinimalKey extending object? */ | |||
| public match(keyevent) { | |||
| // 'in' doesn't include prototypes, so it's safe for this object. | |||
There was a problem hiding this comment.
| // 'in' doesn't include prototypes, so it's safe for this object. |
:)
|
This will become painfully unmergeable with #2566 and unusable with https://hacks.mozilla.org/2020/07/securing-gamepad-api/ so let's close this. |
|
Mozilla keeps taking away our toys : ( |
As bovine3dom said on matrix,
Tridactyl needs gamepad support in order to expand and be able to reach
new users. This is the first step on the road to Tridactyl becoming the
true google-stadia enabled, gamer-oriented, billion-dollars making
service as a software it can be.
Note that I wouldn't actually recommend merging this for the following reasons:
You have to use
requestAnimationFrame()in the content script every time a gamepad is detected, even if it isn't actually used by the user (this is rather inefficient).It doesn't actually work 100% of the time. Sometimes we don't get the gamepadconnected event and users have to disconnect/reconnect their gamepad in order for tridactyl to detect the gamepad again.
Because we do our processing in the content script, pressing any button that changes the current tab also triggers the command in the new tab (because Tridactyl detects that the button is pressed in the new tab before the user has any chance to release it).
Not every gamepad button is supported by the gamepad API. For example, there isn't any way to check for the state of an xbox 360 controller's dirrectional pad.
I didn't implement joystick support. This could probably be done by using angles for bindings but I couldn't be bothered.
For some reason, bindings do not work for the command line. The normal-mode ones are used instead. I didn't check what happened for other modes.
There probably are other reasons not to merge this but these are the ones I can think of right now.