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

Key gets stuck when toggling fullscreen

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.4.2, Minecraft 1.4.7, Snapshot 13w05b, Minecraft 1.5, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w18b, Snapshot 13w18c, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 13w42b, Minecraft 13w43a, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 1.7.4, Minecraft 14w04b, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1, Minecraft 1.8.8, Minecraft 15w40b, Minecraft 1.8.9, Minecraft 16w02a, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12
    • Fix Version/s: Minecraft 17w43a
    • Environment:

      OS X 10.8.2. Java: newest(JRE7)

    • Confirmation Status:
      Confirmed
    • Game Mode:
      Creative

      Description

      When pressing down a key (i.e. "W") and pressing F11 to toggle fullscreen at the same time will cause the action that key handles to continue, when the key is released.

      I expected the action (moving forward) to stop as I released the key.

      What that actually happened was that the action (moving forward) kept on until I pressed another key.

      Steps to Reproduce:
      1. Press and hold down a key that performs a moving action. Do not release it.
      2. Press F11
      3. Release F11
      4. Release the key you pressed in (1.).
      5. Watch. The movement will not stop.
      6. Press and release another key on your keyboard.
      7. The action stops.

      Code analysis

      Based on 1.11 decompiled using MCP 9.35 rc1 and https://github.com/LWJGL/lwjgl on 14. December 2016

      When fullscreen mode is toggled the following methods are called in this order:

      1. org.lwjgl.opengl.Display.setFullscreen(boolean)
      2. org.lwjgl.opengl.Display.destroyWindow()
      3. org.lwjgl.input.Keyboard.destroy()
      4. org.lwjgl.input.Keyboard.reset()

      And org.lwjgl.input.Keyboard.reset() resets the pressed keys. Therefor the keyboard never registers that the keys which were previously pressed are unpressed now.
      This can be solved in Minecraft by calling the method net.minecraft.client.settings.KeyBinding.unPressAllKeys() before returning from the method net.minecraft.client.Minecraft.toggleFullscreen().

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fry [Mojang] Georgii Gavrichev
                Reporter:
                deuphic Deuphic
              • Votes:
                7 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: