When you alt+tab, the alt key gets stuck and returns true after the alt key is releasing for TheInput:IsKeyDown(KEY_ALT). This happens 100% of the time.
This doesn't happen for TheInput:IsControlPressed(CONTROL_FORCE_INSPECT) where CONTROL_FORCE_INSPECT is alt (which is the default).
Both functions are checking if a key is currently pressed/down, and they are returning different outputs, unless I'm misunderstanding something this is a bug.
This isn't limited to just KEY_ALT, it's any keys that are held down during the alt+tab process. For example, if someone holds shift+alt+tab, then alt+tab back into the game, TheInput:IsKeyDown(KEY_SHIFT) will also return true even though shift hasn't been down since the initial alt+tab. It's just easier to use KEY_ALT as a main example since it sticks every time.
This doesn't effect gameplay much since almost all everything in the game uses IsControlPressed, but a lot of mods use IsKeyDown for keybind related settings in modconfigs, and they suffer from buggy behaviour because of this.
I'm using Windows 10 if that matters.
1. have CONTROL_FORCE_INSPECT be alt ("Left Alt"; which it is by default) 2. alt+tab out of dst 3. alt+tab back into dst, but don't press alt again for the rest of the testing (so it doesn't change state) 4. locally run the command: print(tostring(TheInput:IsKeyDown(KEY_ALT))) 5. locally run the command: print(tostring(TheInput:IsControlPressed(CONTROL_FORCE_INSPECT))) 6. notice the output is true and false respectively even though they are checking the same key
-
1
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now