Closed RVillani closed 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;
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
body.bottom-align
class, to apply it only when aligned to the bottom.Script
HISTORY_TOP_ALIGN
option.bottom-align
style class tobody
whenHISTORY_TOP_ALIGN
is true.updateUI
function:HISTORY_TOP_ALIGN
state and add/remove elements accordingly from the top or the bottom of the body.startRemovingLast
now takes a parameter to tell it which element to remove, so the correct element can be computed a single time insideupdateUI
.Add
libuihook
arrow keycodes and fix mirrored side-scroll iconslibuihook
values.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
span.repeat
selector to customize counter.background-color
to sharedspan.key, span.repeat
selector to have their background color defined a single time.Script
_historyLastPressed
set to store previous keys. With this we're able to distinguish repeated key presses.updateUI
function to support repetition counting.parseInt
for keycodes. They're alreadyint
in the JSON parsed from the websocket events._addNewCombination
. Decide whether to add new elements from repetition and key-combination detection instead by comparing current and previous (new) set of pressed keys.Update README with new features