Linux keyboard input bug involving Linux

Discussion in 'PC Bug Reports' started by pentastic, Apr 20, 2017.

  1. Morse

    Morse Terrarian, Fedora 25

    Same issue, frameskip didn't help.
  2. alessio_110

    alessio_110 Terrarian

    Hi all,

    I can confirm that I also experienced such problem on my Laptop (Linux OS). Apparently I have fixed it using @samrocketman suggestion, only step 1. I have opened Terraria through steam twice and both times I needed to input such code on the terminal and the issue went away. Hope this helps.

  3. MytwoleftFeet

    MytwoleftFeet Terrarian, Solus os same issues down to the "T". The X set command works for the session only.
    Last edited: Jun 17, 2017
  4. Mental Mouse

    Mental Mouse Terrarian

    I am/was getting much the same thing (Ubuntu on a PC, downloaded early this month), but it's fairly clear that there's some kind of queue overflow for keyboard input (but only for movement and jumping); when the avatar stops jittering around, it's liable to finish up with the same movements and jumps that I was trying to do while it was spasming. Weirdly, combat attacks are completely unaffected, and I can attack even while the avatar is stuck jerking around or running through the delayed movements.

    I tried the "xset r off" command mentioned above, which gave strictly temporary relief -- I think that's a global X setting which gets overwritten when a new program launches.

    What worked for me was to go to the (Gnome) control panel and turn off keyboard repeating altogether. When I do that, the bug goes away and stays away. Obviously, that has some issues for other programs....

    ETA: I do have the Marathon Medalist achievement, and have seen the bug since I got it.
    Last edited: Jun 30, 2017
  5. Mental Mouse

    Mental Mouse Terrarian

    I note that there's a similar bug reported for Windows 7.
  6. mbfrog

    mbfrog Terrarian

    This issue started for me with 1.3.5. Has input handling changed in that version by any chance? (TL;DR: that's very likely the root cause of the problem)

    Fiddling with frame-skip doesn't do anything (steady 60fps, and freaking zombies don't lag!). This is indeed the same issue as @samrocketman 's fix only alleviates the issue: as soon as I disable keyboard repeat, jumps behave properly but left-right character motion is still kinda sluggish.

    A few details about my config if that helps:

    AMD FX 6300, Nvidia GeForce GTX 1050ti, 8GB RAM.
    Ubuntu 16.04 / Unity desktop: Terraria 1.3.4 was working just fine, while Terraria 1.3.5 exhibited the input issues.
    Ubuntu 17.04 / Unity desktop: Only tested Terraria 1.3.5, input broken as well.

    I also tested Terraria 1.3.4 and 1.3.5 on a laptop (i5/GTX 940m) with Ubuntu 17.04: 1.3.4 ran just fine, as for 1.3.5 mouse input was not working at all, even in the menus. I had to run my GOG version of Terraria through the steam-runtime launcher (which sets-up an Ubuntu 12.10 environment IIRC) to get it to work at all. But in the end, It exhibits the same issue with keyboard repeat.
  7. Leinfors

    Leinfors Quality Assurance Staff Member Moderator Re-Logic

    I updated the title of this thread because this is very distinctly NOT related to the Marathon Medalist conflict, which shares very distinctive symptoms which are completely unlike the Linux input issues.

    Continuing to look into this issue, as its been reported somewhat frequently, and does seem exclusive to Linux.
  8. Metruption

    Metruption Terrarian

    I am still experiencing this issue on fedora 26. I have tried all of the fixes related to fame skip and found none of them to work. This issue did not exist before Terraria version 1.3.5.
  9. mbfrog

    mbfrog Terrarian

    @Metruption: does diabling keyboard repeat work for you?
  10. Darth_BOR

    Darth_BOR Terrarian

    Quickly pressing 2 movement keys and the second pressed is getting stuck. Sometimes though stucks wrong direction (eg. pressing left and then up, down key gets stuck instead of up).
    xset r off, frameskip on/off/subtle and disabling key repeating in kde control panel does not help.

    kubuntu 17.10
  11. Metruption

    Metruption Terrarian

    When playing VVVVVV (another game that has this issue) I noticed that I would receive a series of phantom inputs after releasing a key if I hold it for too long. During a little searching I found this github issue that has lots of useful information about what this bug might be originating from.
  12. evg-zhabotinsky

    evg-zhabotinsky Terrarian

    I'm pretty sure this is a bug in libSDL2. I replaced `Terraria/lib64/` with a fresh build of latest release ( and now it works like a charm! (Prebuilt one from Ubuntu Xenial repos didn't work, however. For whatever reason it is missing some functions used by Terraria...)
    Disabling keyboard autorepeat instead (i.e. `xset r off`) solves the problem too, so this is the same bug.
    Googling "SDL repeat bug" yields results that look relevant.
  13. agamer569

    agamer569 Terrarian

    But if that prevents you from repeating keys, wouldn't you have to spam to keep walking
  14. Mental Mouse

    Mental Mouse Terrarian

    In practice, no you don't. I assume that's about where the game is getting "keypress events", as opposed to testing for "key down" conditions. Combining the two methods of keyboard handling can be pretty tricky, and in this case, the devs seem to have fumbled a bit.
  15. Metruption

    Metruption Terrarian

    this worked for me to fix the issue (tested in VVVVVV as of this post) I can hold down directions to move and space to V
    --- Double Post Merged, Feb 11, 2018, Original Post Date: Feb 11, 2018 ---
    running the command `$ xset r off` fixed this issue
  16. RedWizard

    RedWizard Terrarian

    This is the actual fix. It fixed the problem and I dont have to deal with a cumbersome repeating key workaround -- Just link to or replace the library in the game with this library and making sure to launch the 64b version of the game - this needs to be done manually because steam will run the 32b version and your downloaded library will not be used. I have a link in my home directory pointing to the 64b binary, I just run it manually after I launch steam.
    mbfrog likes this.
  17. maccam94

    maccam94 Terrarian

    Can confirm that I was hitting this bug on Ubuntu 16.04. I downloaded the source for libsdl 2.0.7, extracted it, installed the libraries and headers it wanted (libudev-dev libsamplerate0-dev fcitx-libs-dev), ran ./configure && make && sudo checkinstall. Then copied /usr/local/lib/ over the lib64/ file inside the Terraria game folder. I also edited the Terraria file (a shell script) to make it autodetect the architecture by default instead of using x86. After that, the bug was fixed.

    @devs, please update libSDL2 and fix the script in the next version!
  18. Poulet rôti

    Poulet rôti Terrarian

    I confirm this bug is still present. Here are some details about my system:
    - Ubuntu 18.04.1 LTS
    - GNOME Shell 3.28.2
    - Terraria BuildID: 1780690
    Running `xset r off` after lauching the game fixes it for the current instance though.
  19. mbfrog

    mbfrog Terrarian

    @Poulet rôti : Ubuntu 18.04 comes with SDL 2.0.8, so all you have to do is to delete and from the game/lib and game/lib64 folders. Then if you're on amd64, the script launches the 32 bit version, whatever your platform/OS. So you'll have to start the game by running game/Terraria.bin.x86_64 directly instead of
    Last edited: Aug 12, 2018
  20. whocares123

    whocares123 Terrarian

    ubuntu 16.04
    same issue
    the way I was able to fix it is:

    $ sudo apt update
    $ sudo apt install libsdl2-dev

    copy /usr/lib/x86_64-linux-gnu/
    delete /home/USERNAME/.local/share/Steam/steamapps/common/Terraria/lib/

    paste to both directories
    now the character is moving fine.

    and here is a question:
    the SDL thing was reported by evg-zhabotinsky Jan 27, 2018
    it is 16.08.2018 and still no patch in 6 months?