You are not logged in.

#1 2013-10-05 05:51:45

EvanPurkhiser
Member
From: San Francisco
Registered: 2010-08-17
Posts: 225
Website

Utility for repeating a key while held down for gameing?

Hey guys,

I've recently started playing a MMO game again that requires a lot of keyboard button spamming.

When I played this game on windows I used the AutoHotKey utility to write a script to repeat the key while I had it held down. Are there any utilities out there that I could use that would allow me to repeatedly send keyup/keydown events while I hold down a key? Preferably one that allows me to configure it to only do this when a specific window is focused.

If nothing already exists like this, I was planning on writing a very small utility in C that would do this.

Offline

#2 2013-10-05 06:24:39

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Utility for repeating a key while held down for gameing?

About 1 second worth of google serching: http://code.google.com/p/autokey/

Offline

#3 2013-10-05 06:27:16

EvanPurkhiser
Member
From: San Francisco
Registered: 2010-08-17
Posts: 225
Website

Re: Utility for repeating a key while held down for gameing?

Thanks WoderWoofy,

I did see that, I was somewhat hoping I could go for a more light weight approach (Autokey has some hefty dependencies), but maybe my goal is a little too specific =P

Last edited by EvanPurkhiser (2013-10-05 06:30:44)

Offline

#4 2013-10-05 13:43:58

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 353

Re: Utility for repeating a key while held down for gameing?

Try xdotool. I've used this for simulating activity in Castlevania for PSX.

#!/bin/bash
winid=$(xdotool search "pSX v1.13" | head -n1)
while true
	do
	xdotool keydown --window $winid "x"
	xdotool keyup --window $winid "x"
done
exit 0

Offline

#5 2013-10-06 01:35:38

EvanPurkhiser
Member
From: San Francisco
Registered: 2010-08-17
Posts: 225
Website

Re: Utility for repeating a key while held down for gameing?

xdotool would certainly work for sending keyup / keydown. But Is there a way I can make the script only do this when I'm holding down a key?

I suppose it may look something like this:

while true
do
	# Do something to block while key isn't down

	xdotool keydown --window $winid "x"
	xdotool keyup --window $winid "x"
done

Offline

Board footer

Powered by FluxBB