Maniphest T82492

Can't type tilde (~) in text editing mode - Blender enters fly/walk navigation immediately
Confirmed, NormalBUG

Assigned To
None
Authored By
Ronan Paixão (ronanpaixao)
Nov 7 2020, 7:17 PM
Tags
  • BF Blender
  • User Interface
Subscribers
Germano Cavalcante (mano-wii)
Richard Antalik (ISS)
Ronan Paixão (ronanpaixao)

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71
OS Language: Brazilian Portuguese
Keyboard layout: United States (international)

Blender Version
Broken: version: 2.90.0, branch: master, commit date: 2020-08-31 11:26, hash: rB0330d1af29c0
Worked: don't know

Short description of error
Using the ENG layout the tilde (~) is in this position on the keyboard:

It can be entered by pressing +`.
However, this is the shortcut of another operator:

This conflict causes the VIEW3D_OT_navigate operator to run instead of the FONT_OT_text_insert.
Pressing +` (grave accent) enters into fly/walk navigation even when in text editing mode. This makes it impossible to type letters with tilde (i.e. "ã") directly into Blender.
The workaround for now is typing the text I need in another program and then pasting into Blender.
This is quite annoying, specially for someone who speaks another language, or has the tilde in his name, even if one uses the English user interface.
This bug might be related to T66607.

Exact steps for others to reproduce the error

  1. Open Blender with a new file.
  2. Add a text object.
  3. Enter text mode ().
  4. Press +`

This enters the fly/walk navigation mode immediately, instead of registering the tilde deadkey.

Event Timeline

Ronan Paixão (ronanpaixao) created this task.Nov 7 2020, 7:17 PM
Richard Antalik (ISS) changed the task status from Needs Triage to Needs Information from User.Nov 10 2020, 10:04 PM
Richard Antalik (ISS) added a subscriber: Richard Antalik (ISS).

I can't reproduce this with english keyboard layout. What layout do you use?

Ronan Paixão (ronanpaixao) added a comment.EditedNov 11 2020, 12:44 PM

As reported, my keyboard layout is (in free translation): United States (international).
The input method (language-layout), as reported by Windows, is:

Português (Brasil) - Estados Unidos (internacional)

The actual keyboard is the usual 104-key mechanical keyboard. Specifics and photos can be seen at the manufacturer's site: https://www.hoopson.com.br/produto/mj-70-teclado-mecanico/

To be more thorough, even though my Windows language is in Brazilian Portuguese, I keep my Blender language as English.

Richard Antalik (ISS) added a comment.Nov 11 2020, 9:33 PM

I can't reproduce this even with portugese keyboard input, I am not sure if OS language would have influence there.

Can you check if this happens when you click on File > Defaults > Load Factory Settings?

Running Blender from console with --debug-events I don't see distinction between events whether I am in edit mode or object mode.
If you could check this out it would help us to see if there is some problem.

Edit mode:

wm_event_do_handlers: Handling event
wmEvent  type:217 / LEFT_SHIFT, val:1 / PRESS,
         prev_type:229 / ACCENT_GRAVE, prev_val:2 / RELEASE,
         shift:1, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(535,441), ascii:'', utf8:'', pointer:0000027A68E14128

wm_event_do_handlers: Handling event
wmEvent  type:229 / ACCENT_GRAVE, val:1 / PRESS,
         prev_type:217 / LEFT_SHIFT, prev_val:2 / RELEASE,
         shift:1, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(566,445), ascii:'~', utf8:'~', pointer:0000027A68E15E68

Object mode:

wm_event_do_handlers: Handling event
wmEvent  type:217 / LEFT_SHIFT, val:1 / PRESS,
         prev_type:217 / LEFT_SHIFT, prev_val:1 / PRESS,
         shift:1, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(874,727), ascii:'', utf8:'', pointer:0000027A68E0FCE8

wm_event_do_handlers: Handling event
wmEvent  type:229 / ACCENT_GRAVE, val:1 / PRESS,
         prev_type:217 / LEFT_SHIFT, prev_val:2 / RELEASE,
         shift:1, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(852,671), ascii:'~', utf8:'~', pointer:0000027A68E0F188
Ronan Paixão (ronanpaixao) added a comment.Nov 12 2020, 6:17 PM

I did the load factory settings procedure, but nothing changed.

I dumped the output with --debug-events here:

In this file, I created a "General" file, loaded factory defaults, added the text, pressed Shift+` (this entered fly mode), exited with ESC, entered edit mode with Tab, pressed Shift+` (this should result in a tilde deadkey but entered fly mode, hence the bug), and exited the program.

This might be related to another abnormal behavior I have noticed before, but haven't reported yet. When I'm in an explicitly text widget, I have to hold the shift key for around one second before hitting the grave accent key to get a tilde. If I don't wait (and one second is an awful lot of time when typing), I get the grave accent instead of the tilde.

I used your suggestion of the --debug-events flag again in this dump, in the hope that it will help the solution of this bug:

In this dump, I created a "General" file, when to the scripting view and started typing Shift+` and then a, with different intervals. This should always result in ã, but unless I wait around one second between the shift and the accent, I get à, which is the same as not pressing the shift.

This is what resulted in the scripting file, before I closed the program:

ààãàãããààààã

Richard Antalik (ISS) changed the task status from Needs Information from User to Needs Triage.Nov 12 2020, 9:41 PM
Richard Antalik (ISS) added a subscriber: Germano Cavalcante (mano-wii).

This should be reported event for your Shift+` keypress

wm_event_do_handlers: Handling event
wmEvent  type:217 / LEFT_SHIFT, val:1 / PRESS,
         prev_type:219 / TAB, prev_val:1 / PRESS,
         shift:1, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(793,530), ascii:' ', utf8:'', pointer:0000022308360998

wm_event_do_handlers: Handling event
wmEvent  type:229 / ACCENT_GRAVE, val:1 / PRESS,
         prev_type:219 / TAB, prev_val:2 / RELEASE,
         shift:1, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(793,530), ascii:' ', utf8:'', pointer:0000022308360488

There is difference to mine. I guess this could be same issue as T68577? Can you type ã in some textbox in Blender?

@Germano Cavalcante (mano-wii) Can you reproduce this?

Germano Cavalcante (mano-wii) added a comment.Nov 12 2020, 10:57 PM

I can't reproduce the problem even with the OS in Portuguese and using the Brazilian Portuguese PTB layout for the keyboard.
By the way, I may be looking at the wrong place but by default there is no shortcut assigned to "Fly Navigation":

Richard Antalik (ISS) added a comment.Nov 12 2020, 11:23 PM

It isn't in search, but there is shortcut

Germano Cavalcante (mano-wii) added a comment.Nov 12 2020, 11:42 PM

I had to check the ENG layout to find out where that tilde is.
In the Brazilian layout the position is totally different:

Anyway, I can't reproduce the problem even using the United States layout

Richard Antalik (ISS) added a comment.Nov 13 2020, 12:03 AM

@Ronan Paixão (ronanpaixao) can you check if this happens with different keyboard?

Ronan Paixão (ronanpaixao) added a comment.Nov 13 2020, 3:31 AM

If I use the traditional ABNT2 Brazilian keyboard layout, the problem does not show up, especially considering that the tilde is in a different position like @Germano Cavalcante (mano-wii) pointed out.

However, this would force me to use either an ABNT2 keyboard or just get used to the layout being different from the actual keyboard (and I did have quite a hard time actually getting a US keyboard, which I prefer, in Brazil).

Also, I actually have a cheapo ABNT2 keyboard and tested it. As said, it works fine with the ABNT2 layout, but if I switch the OS layout to United States (international), then the tilde will be "the key under ESC" and the bug persists.

I have also just noticed that not pressing Shift, which should get me the grave accent as a deadkey, also is buggy in that it does not give me the accent, but displays some kind of "Gizmo" menu, even though I'm still in text edit mode.

Some further tests showed me that

  • If I exit the fly mode by clicking with the mouse (not pressing ESC, Enter or another key) and then press a will get me the character I want. I think this is still a bug. And the 1-second-wait is still necessary too.
  • Text boxes in panels (I tested the object naming text box) and the scripting workspace (except the default upper-left 3D view) will work OK (though still get the 1-second bug).
  • For the 1-second bug, the left shift seems more susceptible, while the right shift seems to need less time to actually register.
  • "The key under ESC" events are only triggered when using the "United States (international)" layout (independent of US or ABNT2 physcial keyboards).
  • The option in Edit->Preferences->Keymap->Grave Accent / Tilde Action changes the incorrect "Gizmo menu" to a (also incorrect if in text-edit mode) "Navigation menu".
  • Actually, this option does not trigger the correct menu if I press the grave accent or tilde keys, even in object mode, if the ABNT2 layout is selected.

For me, it looks like "the key under ESC" is generating the fly/gizmo events even when in text-edit mode, where (in my opinion) it shouldn't.

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Jan 28 2022, 3:14 PM
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".
Germano Cavalcante (mano-wii) added a project: User Interface.

Revisiting old bugs.
I can replicate now using Layout ENG.
But I believe this is a Known Issue as I'm not sure if it's possible to prioritize an operator when there is a conflict (FONT_OT_text_insert vs VIEW3D_OT_navigate).
In my opinion the FONT_OT_text_insert operator should always be executed first in these cases.

Germano Cavalcante (mano-wii) renamed this task from Can't type tilde in text editing mode - Blender enters fly/walk navigation immediately to Can't type tilde (~) in text editing mode - Blender enters fly/walk navigation immediately.Jan 28 2022, 3:21 PM
Germano Cavalcante (mano-wii) updated the task description.