10ten-ja-reader icon indicating copy to clipboard operation
10ten-ja-reader copied to clipboard

Don't ignore Shift when it is pressed together with "hold to show" key(s)

Open birtles opened this issue 3 years ago • 1 comments

Yet another keyboard issue I noticed: If you configure Ctrl as the "hold to show" key, while you are holding Ctrl you can't press Shift to cycle dictionaries. Instead, you need to first release Ctrl and then press Shift. That seems a little inconvenient. It's also inconsistent with the behavior for Enter.

I'm pretty sure it's due to the following code:

https://github.com/birchill/10ten-ja-reader/blob/c038d03ac0ea08d624385ea2d8a32c6f3036f1b2/src/content.ts#L318-L332

Note that pressing c doesn't work while Ctrl is being held due to the check for !ctrlKeyPressed here:

https://github.com/birchill/10ten-ja-reader/blob/c038d03ac0ea08d624385ea2d8a32c6f3036f1b2/src/content.ts#L430-L438

Similarly pressing d doesn't work since Ctrl + D in Firefox will try to create a bookmark.

Supporting Ctrl + Shift to toggle dictionaries seems like it should be possible and convenient, however.

birtles avatar Jun 30 '21 07:06 birtles