Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

remap arrow keys problem


  • Please log in to reply
6 replies to this topic
fkg
  • Members
  • 3 posts
  • Last active: Dec 09 2010 09:44 PM
  • Joined: 09 Dec 2010
Hello
I created this script to remap the arrow keys to spacebar-ijkl, that is
spacebar-i give me up,
spacebar-j give me left
and so on

The problem is that now there is a delay in the space bar. If I try to type "space r" too fast the space is ignored. Or if I type "space i" it will activate the hotkey and move the cursor UP.

Is there any way to optimize this? I just want the space bar to act normally unless I'm pressing space bar AND one of the hot keys at the same time.

thanks
FKG

space::Send {space}       
return     
                     
space & I:: 
GetKeyState, state1, Shift
GetKeyState, state2, Control

if state1=D
	SendInput +{UP}
else if state2=D 
	SendInput ^{UP} 
else
SendInput {UP}

return
 
space & L:: 
GetKeyState, state1, Shift
GetKeyState, state2, Control
if state1=D
	SendInput +{RIGHT}
else if state2=D 
	SendInput ^{RIGHT} 
else
SendInput {RIGHT}

return


space & K::
GetKeyState, state1, Shift
GetKeyState, state2, Control 
if state1=D
	SendInput +{DOWN}
else if state2=D 
	SendInput ^{DOWN} 
else
SendInput {DOWN}

return



space & J::
GetKeyState, state1, Shift
GetKeyState, state2, Control
if state1=D
	SendInput +{LEFT}
else if state2=D  
	SendInput ^{LEFT} 
else
SendInput {LEFT}	
return 
 


Frankie
  • Members
  • 2930 posts
  • Last active:
  • Joined: 02 Nov 2008
Try this:
#InstallKeybdHook
Space::
Space := True, Other := False
return

Space Up::
Space := False
If !Other
	SendInput, {Space}
return

*l::
If (!Space)
{
	SendInput {Blind}l
	return
}
Other := True
SendInput, {Blind}{Right}
return

*k::
If (!Space)
{
	SendInput {Blind}k
	return
}
Other := True
SendInput, {Blind}{Down}
return

*j::
If (!Space)
{
	SendInput {Blind}j
	return
}
Other := True
SendInput, {Blind}{Left}
return


fkg
  • Members
  • 3 posts
  • Last active: Dec 09 2010 09:44 PM
  • Joined: 09 Dec 2010
thanks

I still seem to be having the same problem. If I type too fast there is delay with the space bar and I get joined words or the up down , etc hotkeys.

Frankie
  • Members
  • 2930 posts
  • Last active:
  • Joined: 02 Nov 2008
I tested it, I got no problems like that. Might be differences in computers or you type really really fast :D

fkg
  • Members
  • 3 posts
  • Last active: Dec 09 2010 09:44 PM
  • Joined: 09 Dec 2010
I guess I do :lol:

I tested it, I got no problems like that. Might be differences in computers or you type really really fast :D



engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
you might be able to throw in some critical and priority commands to get it to run faster in the background

Devric
  • Guests
  • Last active:
  • Joined: --
Hey guys, nice short cut, i mapped it with the vim style hjkl,

but also need an additional one with the alt key, so i can use only my left hand and alt+ wasd for movement, as well as other alt combos.

so i altered the script to this, but it dosent seem to work

#InstallKeybdHook
Alt::
Alt := True, Other := False
return

Alt Up::
Alt := False
If !Other
   SendInput, {Alt}
return

; ==========w - up
*w::
If (!Alt)
{
   SendInput {Blind}w
   return
}
Other := True
SendInput, {Blind}{Up}
return

; =========d - right
*d::
If (!Alt)
{
   SendInput {Blind}d
   return
}
Other := True
SendInput, {Blind}{Right}
return

; ==========s - down
*s::
If (!Alt)
{
   SendInput {Blind}s
   return
}
Other := True
SendInput, {Blind}{Down}
return

; ==========a - left
*a::
If (!Alt)
{
   SendInput {Blind}a
   return
}
Other := True
SendInput, {Blind}{Left}
return
any way of doing it with alt?

i have simply tried things like !w::Up .... etc but didnt work also