ig3 / zhongwen

A fork of the "Zhongwen" extension modified to support content in iframes.
https://chrome.google.com/webstore/detail/zhongwen-chinese-english/kkmlkkjojmombglmlpbpapmhcaljjkde
GNU General Public License v2.0
0 stars 0 forks source link

Keyboard shortcuts don't work #5

Closed ig3 closed 1 year ago

ig3 commented 1 year ago

It seems they are all implemented assuming that the selected text is in the top frame.

ig3 commented 1 year ago

Part of the problem is that keydown events go to whichever frame has focus, which may not be the same frame as has the selected text. There may be nothing selected in the frame that receives the keydown event.

For some shortcuts, it is necessary get a message from whichever frame receives the keydown event to whichever frame has the selected text. These may be different children of the root frame, nested arbitrarily deep.

A few simple cases have been fixed, more or less, in current master.

ig3 commented 1 year ago

All the keyboard shortcuts seem to be working with recent changes, and I have added a toggle to turn them on/off, off by default so that they don't interfere with data entry so much.