Tiny Tiny RSS: Community

Insert key not captured by keyeventToAction

I am trying to bind the Insert key to a default action (toggle_unread) via a plugin of mine, but all I get in the console is “keyeventToAction [some garbage character I can’t even copy to clipboard] => false”.

One would think that “(45)” would do the trick just fine (see https://keycode.info)

I just updated to the latest commit.

maybe it’s a different code in keydown? you can try changing that debugging message so it also logs keycodes (also if you do that, file a PR, this could be useful).

In tt-rss.js, if we change the line

// Arrow buttons and escape are not reported via keypress, handle them via keydown.
// escape = 27, left = 37, up = 38, right = 39, down = 40, pgup = 33, pgdn = 34
if (event.type == "keydown" && event.which != 27 && (event.which < 33 || event.which > 40)) return;

to

// Arrow buttons and escape are not reported via keypress, handle them via keydown.
// escape = 27, left = 37, up = 38, right = 39, down = 40, pgup = 33, pgdn = 34, insert = 45, delete = 46
if (event.type == "keydown" && event.which != 27 && (event.which < 33 || event.which > 46)) return;

this will solve proper use of Insert and Delete.

I don’t think the others that are listed by https://keycode.info are triggered:

which key
41 select
42 print
43 execute
44 Print Screen
45 insert
46 delete

sure, we can change that. can you file a PR?

merged, thanks.

/20char

Cool!

Plugin updated accordingly: