Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 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 by akks, 10 years ago

In 7217/josm:

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

comment:2 by akks, 10 years ago

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 10 years ago by akks (previous) (diff)

comment:3 by Don-vip, 10 years ago

The new file was forgotten in the commit :)

comment:4 by akks, 10 years ago

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

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

comment:5 by Don-vip, 10 years ago

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 by Don-vip, 10 years ago

is there still something to do on this ticket?

comment:7 by Don-vip, 10 years ago

Resolution: fixed
Status: newclosed

comment:8 by Don-vip, 10 years ago

In 7278/josm:

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

comment:9 by akks, 10 years ago

In 7293/josm:

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

in reply to:  9 comment:10 by skyper, 10 years ago

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 10 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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.