Texter Keybinding Errors

  • RCAProduction
    17th Sep 2019 Member 0 Permalink

    I suppose that this is more or less an error report for the "Texter" lua script available through the manager.

     

    Here is the problem:

     

    You start TPT, select your element and position, then hit "Ctrl + T." The GUI window pops up, you enter your text, hit OK, and the text is produced. You hit "Ctrl + T" again, and nothing happens. The scipt no longer responds to the key combination. 

     

    Closing TPT and reopening right away does not fix the issue. The only way to make the "Ctrl + T" combination work again, is to close TPT and wait a minute or two before reopening. Then, the issue repeats- It works once then will not pick up the key combination.

     

    TPT is running on windows. I have had this issues for years, on Ubuntu, Windows 7, Windows 8, and Windows 10. 

     

    I finally decided to make a post, since I've been trying to use it more lately. 

     

    Here is the function for handling key inputs:

     

    https://pastebin.com/JFRemx4u

     

    Edited 2 times by RCAProduction. Last: 17th Sep 2019
  • jacob1
    17th Sep 2019 Developer 1 Permalink
    Do you have num lock (or caps lock ...) enabled? This would break the script. The script also only works with left ctrl, not right ctrl.

    These are very common mistakes in scripts using the legacy event registration api. It was hard to properly detect stuff like ctrl while accounting for numlock. It checks for "modifier==64", which is the modifier specifically for left ctrl only. If any other modifier (shift, alt, num lock, caps lock) is held, it breaks.

    Edit: a way to check if modifiers are the problem is to type this in the console: tpt.register_keypress(print)
    The third number should be 64 if you press left ctrl
    Edited once by jacob1. Last: 17th Sep 2019
  • RCAProduction
    18th Sep 2019 Member 0 Permalink

    @jacob1 (View Post)

     Aha! Thank you very much for the input. 

     

    I usually have numlock on for work, and I turn on caps lock for entering the strings... Today numlock was off, but I turned on caps lock each time to enter the text. 

     

    The "delay" was just the time it took me to turn it off... Lol

     

    Problem solved.

    Edited once by RCAProduction. Last: 18th Sep 2019