Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years 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 6 years ago.

Download all attachments as: .zip

Change History (27)

comment:1 by Klumbumbus, 6 years ago

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 6 years ago by Klumbumbus (previous) (diff)

comment:2 by Klumbumbus, 6 years ago

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.

by Klumbumbus, 6 years ago

Attachment: 16453.png added

comment:3 by Klumbumbus, 6 years ago

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

Last edited 6 years ago by Klumbumbus (previous) (diff)

in reply to:  2 comment:4 by Don-vip, 6 years ago

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 :)

in reply to:  3 comment:5 by Don-vip, 6 years ago

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

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

@wiktorn is it the ogonek?

comment:8 by Don-vip, 6 years ago

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

comment:9 by Don-vip, 6 years ago

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

comment:10 by Glassman, 6 years ago

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.

in reply to:  7 comment:11 by wiktorn, 6 years ago

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 by gokehufu, 6 years ago

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

In 14012/josm:

see #16453 - proper support of different keyboard layouts

comment:14 by Don-vip, 6 years ago

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

comment:15 by Don-vip, 6 years ago

In 14013/josm:

see #16453 - fix NPE and warnings

comment:16 by Glassman, 6 years ago

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

comment:17 by Don-vip, 6 years ago

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

In 14016/josm:

see #16453 - fix NPE

comment:19 by gokehufu, 6 years ago

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 by Klumbumbus, 6 years ago

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

In 14017/josm:

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

comment:22 by Don-vip, 6 years ago

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

in reply to:  22 comment:23 by wiktorn, 6 years ago

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

In 14022/josm:

see #16453 - support arabic, thai and georgian shortcuts

comment:25 by Don-vip, 6 years ago

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 by Klumbumbus, 6 years ago

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. 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.