Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-118308

Narrator is toggled when typing in some text fields



    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 17w31a, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b
    • Minecraft 17w45a
    • Confirmed


      The bug

      Typing in some text fields can toggle the narrator. This is especially problematic for keyboard layouts where Ctrl + B (shortcut for toggling the narrator) is used to write a different character, for example Czech, Slovak, Hungarian, Croatian, Slovenian, Serbian and a few other Slavic language keyboards where the way to type "{" is Ctrl + Alt + B, or Alt Gr + B.

      Affected text fields

      This affects all but the "last" text field in all GUIs that have more than 1 text field:

      • Command block: command field
      • Same for command block minecarts
      • Structure block:
      • All fields other than "Seed" in load mode
      • All fields other than the 3rd size in save mode
      • The Server Address field when editing/adding a server
      • All fields other than "Main Noise Scale X" on Extra Advanced Settings in customize world settings

      These are also affected, but are caused by not using GuiTextField (and thus would need a different, albeit still simple) fix:

      • sign
      • writable book: title and pages

      How to reproduce

      1. Open one of the GUIs listed above
      2. Click on one of the text fields matching the description above (this is required even if the text field is already focused)
      3. Press Ctrl + B


      This is caused by the fix to MC-117004 being implemented in a per-GUI manner. Rather than the GUI polling each text field to see if it's focused, when a text field changes focus, it updates the boolean as to whether there are any in the GUI that are focused to match its value. This, combined with the fact that text fields set their focus to false whenever there's a click outside of them (even if they aren't currently focused) means that the value effectively only matches whether the last text field is focused (with a special case when the GUI is first loaded).

      The ideal fix would be to go through all text fields and see if they are focused (which isn't performant, but since this check is only performed for narrator, wouldn't be too significant). However, as-is that isn't easy since there is no list of text fields on a GUI (they're handled manually).

      For signs and written books, the check method could be directly overridden to always return true.


        Issue Links



              Unassigned Unassigned
              Golden Drake John
              3 Vote for this issue
              2 Start watching this issue