Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Bug Arrow keys get stuck when you press them.

Discussion in 'Linux' started by milgar_, Sep 21, 2015.

  1. milgar_

    milgar_

    Joined:
    Mar 2, 2014
    Posts:
    14
    After pressing and releasing arrow key, input.keyget always sends true for that key.
     
  2. spacepluk

    spacepluk

    Joined:
    Aug 26, 2015
    Posts:
    243
    I'm also getting this.
     
  3. mortalglitch

    mortalglitch

    Joined:
    Aug 26, 2015
    Posts:
    26
    Same problem here. Glad to know it wasn't just me. I spent an hour or so last night looking back over my code thinking I did something.
    Don't know if it helps but:
    Xubuntu (Ubuntu 14.04 Variant)
    Running XFCE DE (Also occurred in OpenBox)
    Compact Laptop Keyboard( No numpad and has Fn keys to add utility)
    Keyboard Set to English(US)

    Can't think of anything else to add.
     
  4. vailreth

    vailreth

    Joined:
    Aug 31, 2013
    Posts:
    1
    I am having a similar issue when i use Input.Axis where when an arrow key is pressed it is if it were held down and all other arrow keys become ignored.
     
  5. boustrophedon

    boustrophedon

    Joined:
    Sep 4, 2015
    Posts:
    4
    I also have this problem when using Input.GetAxis.
     
  6. aarondev

    aarondev

    Joined:
    Sep 26, 2015
    Posts:
    1
    Yup, me too.

    I'm wondering if it has something to do with other UI elements stealing focus? When I press other arrow keys after the first one, I see various tabs highlighting and un-highlighting (like the Game, Project, and Hierarchy tabs).
     
  7. mortalglitch

    mortalglitch

    Joined:
    Aug 26, 2015
    Posts:
    26
    I have also noticed this with other keys as well. When I press "E" in my game to interact with objects I notice the Scene Keys (Grab, Rotate, Translate, Scale) change.
     
  8. AZeroEight

    AZeroEight

    Joined:
    Sep 29, 2015
    Posts:
    7
    Same here in Gentoo Linux - It definitely has to do with focus stealing. If you click the Game-Tab you can enter another key and lose focus again.
     
  9. micaelr95

    micaelr95

    Joined:
    Sep 28, 2015
    Posts:
    5
    I have this bug too. A just test unity with the defaul project in ubuntu 14.04
     
  10. CyRaid

    CyRaid

    Joined:
    Mar 31, 2015
    Posts:
    134
    While in play mode, does anybody else notice a slowdown when you hold in a keyboard key when 'repeating' gets activated? The delay after hold in the key, it continuously causes small pauses every 'repeat' keyboard event? (while holding it down) .. It almost seems like Unity is doing quite a bit of processing when it gets the repeat key events?
     
  11. bendangelo

    bendangelo

    Joined:
    Nov 12, 2014
    Posts:
    9
    I'm having the same issue, Ubuntu 14.04, unity-editor-5.1.0f3+2015091501_amd64
     
  12. thiagofdp

    thiagofdp

    Joined:
    Sep 6, 2013
    Posts:
    12
    Same bug here. I created my project with Unity3d 5.2 on Windows.
    Then i 'imported' my project into Unity3d 5.1 (unity-editor-5.1.0f3+2015091501_amd64) on my Linux Mint 17.2 + Cinnamon 2.6.13.
    It works perfect on Windows, but it looks like the first button pressed is getting stuck.

    I'm using this code:
    Code (CSharp):
    1. float horizontal = Input.GetAxis ("Horizontal");
     
    Last edited: Oct 30, 2015
  13. NathanWarden

    NathanWarden

    Joined:
    Oct 4, 2005
    Posts:
    663
    My friend and I just noticed this same issue yesterday.
     
  14. kemde

    kemde

    Joined:
    Sep 6, 2015
    Posts:
    16
    Same problem, but only with the up/down keys, others (f.e. w,s) work as expected.
    First tries of a newbie :)

    Code (CSharp):
    1.  
    2. float hPos = GetComponent<Transform>().position.x + ( Input.GetAxis("Horizontal") * Time.deltaTime );
    3. float vPos = GetComponent<Transform>().position.y + ( Input.GetAxis("Vertical") * Time.deltaTime );
    4.  
    5. GetComponent<Transform>().position = new Vector3( hPos, vPos, 0 );
    6.  
    k
     
    ElnuDev and thiagofdp like this.
  15. Philip-Rowlands

    Philip-Rowlands

    Joined:
    May 13, 2013
    Posts:
    353
    I just ran into this as well, running under Linux Mint 17.2 with the Cinnamon desktop and an Irish keyboard layout. However, when I build and run the project, it works as expected.
     
  16. cl9-2

    cl9-2

    Joined:
    May 31, 2013
    Posts:
    417
    I'm also using Linux Mint Rafaela with the latest editor and having the same problem.

    Does anybody know how to activate the alternative input buttons in the manager when the editor is playing?

    And also, what is the #if directive used to identify the Unity Editor specifically under Linux?
     
  17. uberschlock

    uberschlock

    Joined:
    Nov 1, 2015
    Posts:
    1
    Same issue on Fedora 22.
    Tried multiple desktops, no difference.
    When I click on any panel (e. g. Project) in play mode, it catches the keystrokes.
     
  18. omega-xis

    omega-xis

    Joined:
    Nov 2, 2015
    Posts:
    3
    same issue on ubuntu 15.10
     
  19. amarok-blue

    amarok-blue

    Joined:
    Jun 17, 2014
    Posts:
    79
    I'm having the same issue, Ubuntu 15.10, unity-editor-5.1.0f3+2015091501_amd64 :(
     
  20. bkmagnetron

    bkmagnetron

    Joined:
    Nov 18, 2015
    Posts:
    4
    I'm also having the same issue. When I click arrow keys focus cycles to the game window.
     
  21. Tak

    Tak

    Unity Technologies

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Thanks, we'll investigate.
     
    Deleted User likes this.
  22. amarok-blue

    amarok-blue

    Joined:
    Jun 17, 2014
    Posts:
    79
    Same error on Unity 5.2.2. Ubuntu 15.10
     
  23. PudgePacket

    PudgePacket

    Joined:
    Feb 27, 2014
    Posts:
    11
    Getting the same issue in editor in Ubuntu 15.10 Unity 5.2.2f1 Personal. The exact same project copy and pasted to same version of Unity in OSX works flawlessly.
     
  24. spacepluk

    spacepluk

    Joined:
    Aug 26, 2015
    Posts:
    243
    This still happens on 5.3.0f4. I noticed that different axis get stuck depending on whether the viewport is maximized or not.
     
  25. amarok-blue

    amarok-blue

    Joined:
    Jun 17, 2014
    Posts:
    79
    Same error in 5.3.x build :(
     
  26. amarok-blue

    amarok-blue

    Joined:
    Jun 17, 2014
    Posts:
    79
  27. Wulfara

    Wulfara

    Joined:
    Aug 11, 2015
    Posts:
    40
    Today I noticed that if you separate (unpin) the Game Tab from the rest of tabs and run it as a separate window, the arrow keys works well. I think that the reason it works is because there are no other tabs to navigate to with the arrows so the focus doesn't leave the game tab.

    This does not fix the problem but it works as a temporal workaround.
     
    Last edited: Jan 6, 2016
    Deleted User and Philip-Rowlands like this.
  28. spacepluk

    spacepluk

    Joined:
    Aug 26, 2015
    Posts:
    243
    this seems to be fixed on 5.3.1f1
     
    amarok-blue likes this.
  29. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    Last edited: Mar 3, 2016
  30. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    Hey @Tak, I'm still getting this issue on Ubuntu 18.04.1 LTS and Unity 2018.3.0b7. Any ideas? There are no issues with WASD and Left/Right arrow keys, however. I've only got this issue after upgrading from 2018.2.7f1. Thanks for all your help, besides this bug, I'm loving the Linux version of Unity and Unity Hub so far!
     
  31. ljessen

    ljessen

    Joined:
    Sep 15, 2018
    Posts:
    2
    I'm also getting this issue with stuck arrow keys with 2018.3.0f1 on Ubuntu 18.10. The issue is not present in 2018.2.17f1.
     
    ElnuDev likes this.
  32. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    We're in the same position @ljessen. Hopefully, the issue will be fixed soon. :(
     
  33. bobismijnnaam

    bobismijnnaam

    Joined:
    Aug 11, 2013
    Posts:
    4
    Just want to chip in, I have this too on 2018.3.0f2. Was not a problem on 2018.2.7f1. Ubuntu 16.04. Maximize on play fixes it, but then you have to pause the game to see the terminal. Popping the game window out works too, but I can only make that window bigger, not smaller, so placing it in the correct place is a pain. For the rest I have the same experience as #27, when the game doesn't react to the arrow keys when I press qwer the unity tools are selected, instead of nothing happening at all.
     
    ElnuDev likes this.
  34. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    Really? I don't think that worked for me. However, I'll double check.
     
  35. Rodricks87

    Rodricks87

    Joined:
    Jun 18, 2014
    Posts:
    4
    Same problem here using Linux Mint 19.1. "Maximize On Play" does not work. I just can use the WASD keys to move my character.
     
    ElnuDev likes this.
  36. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    Hmm, "Maximize On Play" isn't giving me an issue on Ubuntu 18.04.01 LTS. Weird. :confused:
     
  37. T3hHappyEmo

    T3hHappyEmo

    Joined:
    Aug 15, 2016
    Posts:
    9
    Still getting this issue. Maximize play fixes the left and right arrows for me, but the vertical arrows still lock no matter what I do. Running Unity 2018.3.5 on Lubuntu 18.10.

    Was trying to refresh myself with the UFO tutorial on the official Unity site, but this issue appears to break it on Linux. Even when running the included "completed" game from the asset package.
     
    ElnuDev likes this.
  38. KaplaProd

    KaplaProd

    Joined:
    Jun 17, 2018
    Posts:
    1
    Getting the same issues. On version 2018.3.5f1 with Ubuntu 18.04

    All my keys keep being see as trigerred by Unity while I only pressed them once. Quite annoying... Some fixes ?
     
  39. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    Would you mind submitting a bug through the bug reporter?
     
  40. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    223
    Seems to be the same as https://issuetracker.unity3d.com/is...lay-mode-making-keyboard-input-switch-screens

    I think so because another thread mentioned that input may be stuck when leaving an app with alt+tab.
    So the same thing probably happens when you press the directional arrows on Linux, as they will focus another tab and move the selection.

    Could the original poster check if the bug is present in 2019.2? (it must be alpha only right now)
     
  41. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    Original post is 5 years old mate
     
  42. fahriuzun

    fahriuzun

    Joined:
    Mar 5, 2018
    Posts:
    1
    I'm having the same issue on Ubuntu 18.04.2 (5.0.4) & Unity3d 2018.3.9f1
     
    ElnuDev likes this.
  43. in0finite

    in0finite

    Joined:
    Oct 23, 2017
    Posts:
    8
    Having the same issue on Ubuntu 18.04 with Unity 2018.3.11, while 2018.1 worked fine
     
    ElnuDev and amarok-blue like this.
  44. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    Still with 2018.3.14 2018.3.14f1 on Ubuntu 18.04
     
  45. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    Okay, finally! After nearly four years, it seems to fixed on Unity 2019.1.1f1. Woohoo!
     
    PixelJ likes this.
  46. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    This is amazing.
     
    ElnuDev and amarok-blue like this.
  47. sokolowski776

    sokolowski776

    Joined:
    Nov 16, 2019
    Posts:
    1
    2018.4.12f1 LTS on Ubuntu still with this bug
     
  48. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    It has been fixed in 2019.1.1f1 and later:
     
  49. pitchblende

    pitchblende

    Joined:
    Jan 9, 2020
    Posts:
    71
    I'm new to Unity development, and I've noticed this problem with Unity 2018.4.14f1 on Ubuntu 18.04.

    With the Karting tutorial, I'm not able to steer the kart properly at all - a single tap of the Up arrow sends the kart into permanent forward motion, and the left and right arrows don't seem to take effect in a timely manner. It feels like occasionally the left/right input makes it through but it's several seconds late.

    I added some Debug.Log statements to KeyboardInput.cs and I can see that even after tapping the Up arrow briefly, Input.GetKey(KeyCode.UpArrow) continues to return true indefinitely, even though the key has long been released.

    If I build the game and run it standalone, the input works correctly.

    EDIT: I wrongly assumed that UnityHub would have installed the latest stable version of Unity for me, but I was wrong. I now see that I can manually install 2019.2.17f1, so I'll try that instead.

    EDIT2: I'm thinking that the Karting tutorial selected 2018.4.14f1 for me - so how can I open the Karting project with 2019.2? I can't seem to import it as an existing project.
     
    Last edited: Jan 9, 2020
  50. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    Just change the project type in Unity Hub