Modify

Opened 6 years ago

Last modified 5 years ago

#16732 new defect

Support Brazilian ABNT/ABNT2 keyboard layouts when reordering imagery layers

Reported by: naoliv Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: keyboard layout brazil Cc:

Description

Our top left key is an apostrophe/quote ('/") and thus we can't actually reorder the imagery layers when pressing the back quote key :-)

Is it possible to also support it, please?

https://i.imgur.com/pPGciid.png

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-09-12 00:54:12 +0200 (Wed, 12 Sep 2018)
Revision:14247
Build-Date:2018-09-12 01:32:28
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (14247 en) Linux Debian GNU/Linux testing (buster)
Memory Usage: 763 MB / 6144 MB (589 MB allocated, but free)
Java version: 10.0.2+13-Debian-1, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1600x900, :0.1 1280x1024
Maximum Screen Size: 1600x1024
Java package: openjdk-10-jre:amd64-10.0.2+13-1
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-21
VM arguments: [-Dawt.useSystemAAFontSettings=gasp]
Program arguments: [--language=en]

Attachments (1)

16732.png (40.3 KB ) - added by Don-vip 6 years ago.

Download all attachments as: .zip

Change History (24)

comment:1 by Don-vip, 6 years ago

Keywords: keyboard layout brazil added
Milestone: 18.09

of course!

comment:2 by Don-vip, 6 years ago

Mmm I already handled partially this case, it should work if your OS (not JOSM) is using pt_BR as default locale:

            case "pt": // Portuguese
                if ("BR".equals(l.getCountry())) {
                    // Brazil, https://en.wikipedia.org/wiki/QWERTY#Brazil
                    result.add('\'');

Is it the case? We don't have any API to detect the keyboard layout, so I must guess from something else that JOSM faces a Brazilian keyboard.

I can add support for people using their OS in English but having defined Brazil as their country. I guess this is your setup?

comment:3 by naoliv, 6 years ago

Oh, on that status I did run JOSM with josm --language=en, sorry
The normal output is:

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-09-12 00:54:12 +0200 (Wed, 12 Sep 2018)
Revision:14247
Build-Date:2018-09-12 01:32:28
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (14247 pt_BR) Linux Debian GNU/Linux testing (buster)
Memory Usage: 857 MB / 6144 MB (580 MB allocated, but free)
Java version: 10.0.2+13-Debian-1, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1600x900, :0.1 1280x1024
Maximum Screen Size: 1600x1024
Java package: openjdk-10-jre:amd64-10.0.2+13-1
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-21
VM arguments: [-Dawt.useSystemAAFontSettings=gasp]

My environment:

$ locale
LANG=pt_BR.UTF-8
LANGUAGE=pt_BR:pt:en
LC_CTYPE="pt_BR.UTF-8"
LC_NUMERIC="pt_BR.UTF-8"
LC_TIME="pt_BR.UTF-8"
LC_COLLATE="pt_BR.UTF-8"
LC_MONETARY="pt_BR.UTF-8"
LC_MESSAGES="pt_BR.UTF-8"
LC_PAPER="pt_BR.UTF-8"
LC_NAME="pt_BR.UTF-8"
LC_ADDRESS="pt_BR.UTF-8"
LC_TELEPHONE="pt_BR.UTF-8"
LC_MEASUREMENT="pt_BR.UTF-8"
LC_IDENTIFICATION="pt_BR.UTF-8"
LC_ALL=

comment:4 by naoliv, 6 years ago

But even when using pt_BR, I can see that the shortcut says "grave accent"

comment:5 by Don-vip, 6 years ago

There will be several shortcuts and the first one will always be grave accent, US QWERTY shortcut is always enabled and displayed first, as it is a very common layout. You should see a second shortcut with quote.

comment:6 by naoliv, 6 years ago

This is what I see here:

https://i.imgur.com/j5A9cI6.png

Where "crase" means "grave accent".

But even on my other machine, which differs for having an US International keyboard layout, it doesn't work.

At the machine with the international layout, with xev I can see that the first time that I press the grave accent it captures a dead_grave key; only for the second time it captures a grave key.
ie, press grave once, dead_grave; again, grave; another time, dead_grave, and so on.

So it seems that maybe it would be better to have some default values and also offer a way to let the user override that key?

by Don-vip, 6 years ago

Attachment: 16732.png added

comment:7 by Don-vip, 6 years ago

You can already change shortcuts:


Can you please take the same screenshot before you change anything?

comment:8 by Don-vip, 6 years ago

Owner: changed from team to naoliv
Status: newneedinfo

comment:9 by naoliv, 6 years ago

Both at the computer with an US International keyboard and the one with the ABNT2 keyboard I have:

https://i.imgur.com/4Jo84bl.png

Where:
Crase = AWT.backQuote = Back Quote
Acento Grave = AWT.deadGrave = Dead Grave

If I run JOSM with --language=en:

https://i.imgur.com/4cUOKC4.png

Pressing back quote|dead grave (at the international layout) or apostrophe|quote (at the ABNT2) doesn't work here to switch the layers :-)

comment:10 by Don-vip, 6 years ago

Owner: changed from naoliv to team
Status: needinfonew

comment:11 by Don-vip, 6 years ago

Can you please launch josm --trace and report output when you type the key once? You should get three lines like this:

2018-09-29 22:19:24.268 LE PLUS PRÉCIS: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_PRESSED,keyCode=0,keyText=Inconnu keyCode: 0x0,keyChar='œ',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=49,primaryLevelUnicode=339,scancode=0,extendedKeyCode=0x1000153] on org.openstreetmap.josm.gui.MapView[,0,0,585x601,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=java.awt.Dimension[width=10,height=0],preferredSize=]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)
2018-09-29 22:19:24.274 LE PLUS PRÉCIS: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Inconnu keyCode: 0x0,keyChar='œ',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=339,scancode=0,extendedKeyCode=0x0] on org.openstreetmap.josm.gui.MapView[,0,0,585x601,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=java.awt.Dimension[width=10,height=0],preferredSize=]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)
2018-09-29 22:19:24.327 LE PLUS PRÉCIS: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_RELEASED,keyCode=0,keyText=Inconnu keyCode: 0x0,keyChar='œ',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=49,primaryLevelUnicode=339,scancode=0,extendedKeyCode=0x1000153] on org.openstreetmap.josm.gui.MapView[,0,0,585x601,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=java.awt.Dimension[width=10,height=0],preferredSize=]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)

comment:12 by naoliv, 6 years ago

One press on ` (on the US internation keyboard here; on the ABNT2 one I will be able to test only on monday)

2018-09-29 17:26:19.293 O MAIS DETALHADO: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_RELEASED,keyCode=128,keyText=Acento Grave,keyChar='ˋ',keyLocation=KEY_LOCATION_STANDARD,rawCode=49,primaryLevelUnicode=715,scancode=0,extendedKeyCode=0x80] on org.openstreetmap.josm.gui.MapView[,0,0,1383x1020,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=java.awt.Dimension[width=10,height=0],preferredSize=]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)

Pressing a second time there are 2 events:

2018-09-29 17:27:35.675 O MAIS DETALHADO: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Desconhecido keyCode: 0x0,keyChar='`',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x0] on org.openstreetmap.josm.gui.MapView[,0,0,1383x1020,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=java.awt.Dimension[width=10,height=0],preferredSize=]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)
2018-09-29 17:27:35.720 O MAIS DETALHADO: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_RELEASED,keyCode=128,keyText=Acento Grave,keyChar='ˋ',keyLocation=KEY_LOCATION_STANDARD,rawCode=49,primaryLevelUnicode=715,scancode=0,extendedKeyCode=0x80] on org.openstreetmap.josm.gui.MapView[,0,0,1383x1020,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=java.awt.Dimension[width=10,height=0],preferredSize=]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)

comment:13 by Don-vip, 6 years ago

Thanks. Can you please also give me the output of localectl status?

comment:14 by naoliv, 6 years ago

International keyboard:

$ localectl status
   System Locale: LANG=pt_BR.UTF-8
                  LANGUAGE=pt_BR:pt:en
       VC Keymap: n/a
      X11 Layout: us
       X11 Model: pc105
     X11 Variant: intl

ABNT2 (this one I can get with SSH :-)):

$ localectl status
   System Locale: LANG=pt_BR.UTF-8
                  LANGUAGE=pt_BR:pt:en
       VC Keymap: n/a
      X11 Layout: br
       X11 Model: a4techKB21

comment:15 by Don-vip, 6 years ago

Type: enhancementdefect

comment:16 by Don-vip, 6 years ago

Resolution: fixed
Status: newclosed

In 14279/josm:

fix #16732 - fix support of US International keyboard layout

comment:17 by Don-vip, 6 years ago

In 14282/josm:

see #16732 - more keyboard fixes

comment:18 by naoliv, 6 years ago

Resolution: fixed
Status: closedreopened

Just tested [14286] and it still doesn't switch the layers here when pressing ` :-(
Is there anything else that I can do to help debug this, please?

comment:19 by naoliv, 6 years ago

With the ABNT2 keyboard, by default, it was also not working.
But I could get it working by manually forcing a ' value.

Key events:

2018-10-01 09:14:18.020 O MAIS DETALHADO: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_PRESSED,keyCode=222,keyText=Aspas,keyChar=''',keyLocation=KEY_LOCATION_STANDARD,rawCode=49,primaryLevelUnicode=39,scancode=0,extendedKeyCode=0xde] on org.openstreetmap.josm.gui.IconToggleButton[,0,0,36x36,alignmentX=0.0,alignmentY=0.5,border=javax.swing.border.CompoundBorder@30b36b4d,flags=8388904,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@178b2efb,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=null]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)
2018-10-01 09:14:18.020 O MAIS DETALHADO: org.openstreetmap.josm.actions.mapmode.SelectAction@63557664 => doKeyPressed(java.awt.event.KeyEvent[KEY_PRESSED,keyCode=222,keyText=Aspas,keyChar=''',keyLocation=KEY_LOCATION_STANDARD,rawCode=49,primaryLevelUnicode=39,scancode=0,extendedKeyCode=0xde] on org.openstreetmap.josm.gui.IconToggleButton[,0,0,36x36,alignmentX=0.0,alignmentY=0.5,border=javax.swing.border.CompoundBorder@30b36b4d,flags=8388904,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@178b2efb,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=null])
2018-10-01 09:14:18.022 O MAIS DETALHADO: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Desconhecido keyCode: 0x0,keyChar=''',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=39,scancode=0,extendedKeyCode=0x0] on org.openstreetmap.josm.gui.IconToggleButton[,0,0,36x36,alignmentX=0.0,alignmentY=0.5,border=javax.swing.border.CompoundBorder@30b36b4d,flags=8388904,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@178b2efb,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=null]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)
2018-10-01 09:14:18.071 O MAIS DETALHADO: AdvancedKeyPressDetector enabled=true => processKeyEvent(java.awt.event.KeyEvent[KEY_RELEASED,keyCode=222,keyText=Aspas,keyChar=''',keyLocation=KEY_LOCATION_STANDARD,rawCode=49,primaryLevelUnicode=39,scancode=0,extendedKeyCode=0xde] on org.openstreetmap.josm.gui.IconToggleButton[,0,0,36x36,alignmentX=0.0,alignmentY=0.5,border=javax.swing.border.CompoundBorder@30b36b4d,flags=8388904,maximumSize=,minimumSize=,preferredSize=,defaultIcon=javax.swing.ImageIcon@178b2efb,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=null]) from java.desktop/java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2194)

For the international keyboard I couldn't find a key that works.

comment:20 by Don-vip, 6 years ago

Milestone: 18.0918.10

:( I need to perform more tests with Linux. Is there a way to enable a virtual keyboard on Debian?

comment:21 by Don-vip, 5 years ago

Milestone: 18.1018.11

comment:22 by Don-vip, 5 years ago

Milestone: 18.1118.12

comment:23 by Don-vip, 5 years ago

Milestone: 18.12
Status: reopenednew

It's very hard for me to debug this issue. Time to look up for a Brazilian Java developer :)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to naoliv.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


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