The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
My Google-fu is failing me. The problem (I think) is easy to describe, but not to Google, apparently.
Does anyone know of a really simple tool that can simulate a key being held down...and--this is important in this context--can easily be toggled on and off?
My reason for asking: I have a game that often requires me to walk in what is essentially a straight line in some direction for quite some distance, and I have to press and hold down the 'walk' button ("W" in this case; the game's using the standard "WASD" arrangement) for minutes at a time. This often gets tedious, and so every once in a while I take a small but heavy object and try to balance it carefully on the key that needs to be held down...then while my character is moving on his own, I can do something else on another computer I have sitting next to me for a moment or two.
The problem is the "carefully balancing the object on the key" part. So I'm looking for a software solution. Ideally a one-key toggle, as in, "when I press this key (or key combination), simulate holding down this other button"...then press it again to "release" the button.
Of course I don't want something that needs me to alt-tab out of the game and back.
This is totally a first-world problem...but a solution would help remove one of the more tedious elements of this game. After all, I play to take some drudgery out of my life, not add to it...
I was thinking you could maybe run a program that registers a system-wide hotkey (assuming Windows here, since you didn't mention).
Then, when you hit the Ctrl-Alt-Shift-W or whatever the program would do keypresses (SendKey Windows KeyPress for 'w') foryou.
However, if the game is full-screen I don't think it'll respect the system-wide hotkey. I'm not sure.
If it doesn't then you would have to do this with hardware. Hardware Solution
This can be done very easily with a Arduino Leonardo (aka Pro Micro) because you plug one of those into a system running any OS (Linux, Win, Mac) and it will be recognized as a keyboard (it has built-in USB HID and is recognized as a keyboard.
You can get one for $7 USD (Amazon.com: FTCBlock Pro Micro ATmega32U4 5V/16MHz Module Boardc[^])
Then, it is a very simple matter of wiring up two buttons and a little code on the Arduino so when you hit one button, it continually types 'w' and then when you hit the other it stops.
If you have to go the hardware route, and you really want to try it I am happy to give a lending hand.
However, I understand that this is more extensive.
I never used it but a friend of mine had a gamer mouse where you could save macros. He did something like "click in this button, run 10 minutes" or "click that button, do action 100 times in a row" or things like that. The mouse was called something like "nostromo?"
This was around 8 years ago, I suppose nowadays should be easier to find something similar.
Not sure if the game must be "compatible" though.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
Well, I can't really predict how long to hold the key down for, and sometimes I might need to "let go" of it quickly, so I can't use something that might insist on repeating something for some specified amount of time.
I think OG had the right idea - find something else that'll be easier to physically hold the key down. Although I'll look into that "AutoHotKey" thing someone else has suggested...
Last Visit: 11-Aug-20 7:08 Last Update: 11-Aug-20 7:08