Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10647 closed defect (fixed)

Shortcuts are activated while in dialogs.

Reported by: akks Owned by: team
Priority: major Milestone: 14.10
Component: Core Version: latest
Keywords: template_report, shortcut Cc:

Description (last modified by akks)

(reported by maxphizik on Russian forum)

What steps will reproduce the problem?

  1. Use JOSM newer than r7618.
  2. Enter drawing mode (A).
  3. Press Alt-A or open any other window.
  4. Type text with multiple 'A'

What is the expected result?

Just entering A or ignoring keypress

What happens instead?

Angle snapping turns on and off :)
The same with other keyDetector-based events.

Please provide any additional information below. Attach a screenshot if possible.

Maybe it is combination of r7618 and my r7609...

By the way, that MASSIVE shortcut activation/deactivation in http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java seems ineffective. There should be simpler solution like correct filtering in processKeyEvent.

That focus listening and checking is always buggy. We'd beter minimize it but I do not know convenient way.
Maybe remove focus checking in AnvacedKeyPressDetector and make it enabled/disabled at right moments? Do not know, need to think together with the team.

Revision: 7620
Is-Local-Build: true
Build-Date: 2014-10-18 23:25:05

Identification: JOSM/1.5 (7620 SVN ru) Windows 8.1 64-Bit
Memory Usage: 163 MB / 1796 MB (54 MB allocated, but free)
Java version: 1.8.0_25, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM

Plugins:
- FastDraw (30710)
- ImageryCache (30416)
- InfoMode (30416)
- PicLayer (30436)
- buildings_tools (30485)
- imagery_offset_db (30534)
- measurement (30641)
- reltoolbox (30587)
- reverter (30521)
- tagging-preset-tester (30592)
- utilsplugin2 (30460)
- waydownloader (30693)
- waypoint_search (30416)

Attachments (0)

Change History (8)

comment:1 Changed 5 years ago by akks

Description: modified (diff)

comment:2 Changed 5 years ago by akks

Description: modified (diff)

comment:3 Changed 5 years ago by Don-vip

Replying to akks:

Maybe remove focus checking in AdvancedKeyPressDetector and make it enabled/disabled at right moments? Do not know, need to think together with the team.

By the way, that MASSIVE shortcut activation/deactivation in http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java seems ineffective. There should be simpler solution like correct filtering in processKeyEvent.

Last time I checked it was functional. But only in these text fields (layer name editor and relation filter). We could disable AdvancedKeyPressDetector in JosmTextField.

comment:4 Changed 5 years ago by akks

DisableShortcut..Boxes work OK.

We can disable keyDetector but A toggles align not only in textfields, but also in other opened dialogs like Dowload area.

comment:5 Changed 5 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 7631/josm:

fix #10647 - Shortcuts are activated while in dialogs

comment:6 Changed 5 years ago by Don-vip

In 7632/josm:

see #10647 - fix NPE

comment:7 Changed 5 years ago by akks

Thank you!

I have found a problem in my commit too, checking the focus was forgotten in one place, so in other windows the A/X/.. still worked (while downloading area, or when the button is focused). Fix committed.

After your fixes we now can use AutoCompletingComboBox, DisableShortcutsOnFocusGainedTextField, JosmPasswordField, JosmTextArea and JosmTextField in main window without activating keyDetector (however, one-key shortcuts will work).

Last edited 5 years ago by akks (previous) (diff)

comment:8 Changed 5 years ago by akks

In 7633/josm:

see #10647: completely disable Main.map.keyDetector events while not in main window

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.