|
From: SourceForge.net <no...@so...> - 2006-09-20 21:22:46
|
Bugs item #1547186, was opened at 2006-08-26 08:35 Message generated for change (Comment added) made by ezust You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=1547186&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: keyboard / mouse Group: None Status: Open Resolution: None Priority: 7 Submitted By: Alan Ezust (ezust) Assigned to: Xuan Baldauf (mediumnet) Summary: menu mnemonics getting invoked when overridden by shortcuts Initial Comment: I noticed that when I use new keyboard handling with linux, and I bind a key which corresponds to a mnemonic on the menu bar, that the jedit action is invoked and then the menu bar is mistakenly selected afterwards. ---------------------------------------------------------------------- >Comment By: Alan Ezust (ezust) Date: 2006-09-20 14:22 Message: Logged In: YES user_id=935841 Some of your refactoring caused a problem I saw before when you were first implementing your simplified keyboard handling: that is, that global shortcuts are no longer usable inside dockables, or from the incremental search bar, which means "find next" for example, doesn't work from i-search anymore. ---------------------------------------------------------------------- Comment By: Xuan Baldauf (mediumnet) Date: 2006-09-20 02:00 Message: Logged In: YES user_id=506885 The problem is that KEY_PRESSED, KEY_RELEASED events should be low level key events and KEY_TYPED events should be high level key events (including software generated virtual key repetition). KEY_TYPED events should be dependent on KEY_PRESSED events. That is, for example, if KEY_PRESSED events are consumed, KEY_TYPED events should not be generated. And every KEY_TYPED event should be preceded by a KEY_PRESSED event. Unfortunately, all these properties above are not the case. If they were the case, it would be sufficient to listen for local KEY_TYPED events for the editor data and to listen for global KEY_PRESSED events for the global shortcuts. These problems are now getting complicated because jEdit has its own keyboard sequence-detection and -handling, which intermixes global and local KEY_TYPED and KEY_PRESSED events and then spits out some actions and some characters to be inserted into the current editor buffer. I think that the information of KEY_TYPED vs. KEY_PRESSED and of global vs. local should be preserved throughout the whole keyboard event handling. Then the problems might be fixed. ---------------------------------------------------------------------- Comment By: Alan Ezust (ezust) Date: 2006-09-19 19:14 Message: Logged In: YES user_id=935841 I never really understood why sometimes I needed to overide the KEY_PRESSED and other times I needed to override KEY_TYPED to capture certain kinds of events - it's so annoying that there are both. Thank you for investigating and explaining the issues, both in the trackers and in the documentation. As for how to solve this dilemma, I'm not sure what the answer is. Are there other developers who have more experience with this that would like to comment? ---------------------------------------------------------------------- Comment By: Xuan Baldauf (mediumnet) Date: 2006-09-19 16:47 Message: Logged In: YES user_id=506885 The guess is similar to bug 1542026, but the solution might be different: KEY_TYPED events are recognized by jEdit while KEY_PRESSED events are recognized by the Swing Menu subsystem. Because both of these events are generated for one keypress, both subsystems are "activated" by one keypres. A solution candidate is to consume all KEY_PRESSED events whenever the corresponding KEY_TYPED events would be consumed, too. However, implementing this would be rather invasive. Are there better ideas? The old keyboard handling is based on the KEY_PRESSED events (while the new keyboard handling is based on the KEY_TYPED events) and thus, the old keyboard handling does not suffer from this problem. ---------------------------------------------------------------------- Comment By: Xuan Baldauf (mediumnet) Date: 2006-09-19 08:18 Message: Logged In: YES user_id=506885 I think that bug 1547186 and bug 1542026 are related to each other. In both cases, the jEdit key handling and the Swing menu handling do not eat key events from each other. ---------------------------------------------------------------------- Comment By: Xuan Baldauf (mediumnet) Date: 2006-09-19 08:09 Message: Logged In: YES user_id=506885 Okay, I can confirm the problem. Example: map "Alt+E" to an action of your choice (e.g. "About jEdit..."). Then, when pressing "Alt+E", the "Edit" menu popps up very shortly and then the "About jEdit" dialog popps up. The correct way should be that the "Edit" menu should not pop up. ---------------------------------------------------------------------- Comment By: Alan Ezust (ezust) Date: 2006-09-17 21:56 Message: Logged In: YES user_id=935841 xuan? ping? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=1547186&group_id=588 |