Modify

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#16453 closed enhancement (fixed)

Support other keyboard layouts than QWERTY/AZERTY for ReorderImageryLayers action

Reported by: Don-vip Owned by: Don-vip
Priority: normal Milestone: 18.07
Component: Core imagery Version:
Keywords: keyboard Cc: wiktorn

Description

Follow-up of #11556. It does not work for QWERTZ layout used in German-speaking countries. And also for all other layouts than QWERTY/AZERTY.

It's really hard to get physical key codes in Java (scancodes). It either requires JNI/JNA (no-go for JOSM) or reflection into OpenJDK classes, but it seems to work only for Windows (also no-go).

We can't register all possible keys at the same time but maybe we can, based on current locale, register the three/four plausible characters. Even if not perfect, this should work for most of our users.

Attachments (1)

16453.png (2.3 KB) - added by Klumbumbus 3 months ago.

Download all attachments as: .zip

Change History (27)

comment:1 Changed 3 months ago by Klumbumbus

Replying to Don-vip:

Both keys are mapped, you should see two entries with same text in shortcut preferences.

Your're right, however:

  1. after clicking on the shortcut entry in the list in the preferences the default magically changed from ² to Strg+Umschalt+² (=Ctrl+Shift+²)
  2. This is wrong as you reach ² via AltGR+2 or mostly Ctrl+Alt+2 (notice 2 vs. ² and Shift vs. Alt)
  3. The alternative is somehow wrong too. There is no Tilde (Dead) key on my keyboad, only ~ ;)


Last edited 3 months ago by Klumbumbus (previous) (diff)

comment:2 Changed 3 months ago by Klumbumbus

Replying to Don-vip:

The goal is to use the key next to "1".

It's ​really hard to get physical key codes in Java (scancodes)

Why is this so important in this case? Why not handle it like with all other shortcuts: Simply assign a default shortcut and if the user is not happy with the choice he can change it.

Changed 3 months ago by Klumbumbus

Attachment: 16453.png added

comment:3 Changed 3 months ago by Klumbumbus

(BTW, not sure about other languages, but ~ is not a dead key on german keyboards, it is printed immediately.)

Version 0, edited 3 months ago by Klumbumbus (next)

comment:4 in reply to:  2 Changed 3 months ago by Don-vip

Replying to Klumbumbus:

Why is this so important in this case? Why not handle it like with all other shortcuts: Simply assign a default shortcut and if the user is not happy with the choice he can change it.

I find this so well located (no need to search it on the keyboard) that I would like all JOSM users benefit from this default settings, not just those using the American, German and French keyboards :)

comment:5 in reply to:  3 Changed 3 months ago by Don-vip

Replying to Klumbumbus:

(BTW, not sure about other languages, but ~ is not a dead key on german keyboards, it is displayed immediately.)

We don't display this text, Java does by itself. I don't know why.

comment:6 Changed 3 months ago by Don-vip

Cc: wiktorn added

@wiktorn: what's the character displayed in the first key on this keyboard? https://upload.wikimedia.org/wikipedia/commons/c/c0/Klawiatura_Polski_214.jpg

comment:7 Changed 3 months ago by Don-vip

@wiktorn is it the ogonek?

comment:8 Changed 3 months ago by Don-vip

Owner: changed from team to Don-vip
Status: newassigned

comment:9 Changed 3 months ago by Don-vip

Ticket #16460 has been marked as a duplicate of this ticket.

comment:10 Changed 3 months ago by Glassman

One suggestion - change the function to go up or down the list of images and then use the up/down or left/right arrow along with another key like Alt. Up/Down would be closer to the layers box showing the imagery.

comment:11 in reply to:  7 Changed 3 months ago by wiktorn

Replying to Don-vip:

@wiktorn is it the ogonek?

It looks like modifier key for both ogonek and dot. Though I've never used this keyboard layout. Most common in Poland is Polish programmer layout, which is very similar to EU layouts and has tilde character in the top left.

Though under Windows (but not under Linux/FreeBSD) tilde key is used as modifier for ogonek characters.

comment:12 Changed 3 months ago by gokehufu

Doesn't work for QWERTY keyboards either. On Ubuntu 17.10 if I reassign reorder imagery to back quote it will work with a keyboard layout without dead keys (assigning it to shift+back quote makes the tilde key start to work). With a keyboard layout using dead keys I can't get it to work at all (I can tell the dead keys are working because I can enter text with the accents into JOSM).

comment:13 Changed 3 months ago by Don-vip

In 14012/josm:

see #16453 - proper support of different keyboard layouts

comment:14 Changed 3 months ago by Don-vip

@Klumbumbus, @gokehufu, @wiktorn: please test with JOSM latest (r14012+) and your respective keyboard layout.

comment:15 Changed 3 months ago by Don-vip

In 14013/josm:

see #16453 - fix NPE and warnings

comment:16 Changed 3 months ago by Glassman

On my Linux EN:US keyboard, the backquote "`" works, but the Tilde "~" (Shift Backquote) does not work.

comment:17 Changed 3 months ago by Don-vip

That's intended, the shortcut is without modifier, so it doesn't work if you press Shift. Tilde is meant for keyboard layouts where backquote and tilde are inversed.

comment:18 Changed 3 months ago by Don-vip

In 14016/josm:

see #16453 - fix NPE

comment:19 Changed 3 months ago by gokehufu

Now works on US Eng on Ubuntu 17.10. Doesn't work with US Eng International (guess that's because it's a dead key in that layout).

comment:20 Changed 3 months ago by Klumbumbus

I have 3 shortcuts in the preferences now: "circumflex", "closing quotation mark" and "~". None of them work on german QWERTZ. The only one without modifier is circumflex and this is displayed in the imagery menu too. It is a dead key in this layout too.

comment:21 Changed 3 months ago by Don-vip

In 14017/josm:

see #16453 - support dead keys. Drop ancient Polish keyboards not used anymore

comment:22 Changed 3 months ago by Don-vip

Now it should work, can you please test with r14020+?

comment:23 in reply to:  22 Changed 3 months ago by wiktorn

Replying to Don-vip:

Now it should work, can you please test with r14020+?

Polish Programmer keyboard layout under Windows and Linux works OK.

comment:24 Changed 3 months ago by Don-vip

In 14022/josm:

see #16453 - support arabic, thai and georgian shortcuts

comment:25 Changed 3 months ago by Don-vip

Resolution: fixed
Status: assignedclosed

I think this is fixed. I wasn't able to make it work with Spanish and Icelandic keyboard layouts, but that's a Java bug I can't workaround. Please reopen if it doesn't work for another keyboard layout.

comment:26 Changed 3 months ago by Klumbumbus

Works fine on german QWERTZ now. 👍

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
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.