Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10104 closed enhancement (fixed)

Use single AWTEventListener for key press/release and alt/shift/ctrl detection

Reported by: akks Owned by: team
Priority: normal Milestone: 14.06
Component: Core Version: latest
Keywords: Cc:

Description

In #7991 and #3910 there was mentioned a problem: sometimes we need to detect repeated key press or release but do not want to receive events then key is hold. There are some workarounds using AWTEventListener that allow it but this should be synchronized and not copy-pasted to all mapmodes and plugins.

AWTEventListener was also widely used to detect changing of CTRL/ALT/SHIFT modifier keys.

The proposed change is to unify all this "advanced" key handling in separate class AdvancedKeyPressDetector and make it avalable as Main.map.keyDetector.

Attachments (0)

Change History (10)

comment:1 Changed 5 years ago by akks

In 7217/josm:

see #10104: refactor key press/release detection introducing Main.map.keyDetector

comment:2 Changed 5 years ago by akks

It would be very good if someone can check that the behavior did not change on Linux and Mac .
(cursor changing on Alt-Shift-Ctrl could be affected for all modes and repeating&holding X and A)

Code improvements are also welcome.

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

comment:3 Changed 5 years ago by Don-vip

The new file was forgotten in the commit :)

comment:4 Changed 5 years ago by akks

Oops, sorry. 3 Files, actually :) 7219/josm

Last edited 5 years ago by Don-vip (previous) (diff)

comment:5 Changed 5 years ago by Don-vip

Summary: Use single AWTEventListener for key press/relese and alt/shift/ctrl detectionUse single AWTEventListener for key press/release and alt/shift/ctrl detection

comment:6 Changed 5 years ago by Don-vip

is there still something to do on this ticket?

comment:7 Changed 5 years ago by Don-vip

Resolution: fixed
Status: newclosed

comment:8 Changed 5 years ago by Don-vip

In 7278/josm:

fix #10212, see #10104 - ImproveWayAccuracy: key listeners forgot to remove themselves

comment:9 Changed 5 years ago by akks

In 7293/josm:

Fix resource leaks when closing map in Lasso mode, see #10104

comment:10 in reply to:  9 Changed 5 years ago by skyper

Replying to akks:

In 7293/josm:

Fix resource leaks when closing map in Lasso mode, see #10104

Maybe this was the reason for #10233.

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

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.