univrsal / input-overlay

Show keyboard, gamepad and mouse input on stream
GNU General Public License v2.0
2.63k stars 235 forks source link

Option to align to top and repetition counter #369

Closed RVillani closed 9 months ago

RVillani commented 9 months ago

Add option to align input history to top

Default state is off to keep previous behavior. If on, new keys are added to the top, instead of bottom of the page.

CSS

Script

Add libuihook arrow keycodes and fix mirrored side-scroll icons

Add repeated input count

Repeated key presses (optionally, held keys too) now generate a single input in the history, with a counter displaying how many times the key/combination was pressed.

There's a time to reset the counter, after which another repeated input is added as a new input, making it easier to distinguish quick consecutive inputs from slower ones.

CSS

Script

Update README with new features

univrsal commented 9 months ago

Thanks again for the contribution, the changes seem to work fine for me. I did however notice that the mouse side buttons both result in the same icon. It seems like the data.mask value is 4096 for both of them for some reason, which is probably an issue in libuiohook. For now we could use a hack like this in line 894 since data.button always contains the correct mouse button id (4 for the first extra mouse button and 5 for the second one):

          // Fix the bit mask for the extra mouse buttons
          if (data.button === 4 && data.event_type === "mouse_pressed")
            data.mask = (data.mask ^ 4096) | 2048;