AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Conditionally remap TAB but retain default ALT+TAB

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
juhu
Guest





PostPosted: Thu Jan 28, 2010 9:43 pm    Post subject: Conditionally remap TAB but retain default ALT+TAB Reply with quote

Hi all, I've just started using AutoHotKey and so far I'm loving it. However, I've run into a big problem that I can't seem to solve.

If you've ever used OpenOffice Calc, you know that the TAB button functionality isn't exactly the same as in MS Excel. Long story short, in MS Excel, TAB is essentially the same as RIGHT ARROW and that's what I want to port over to Calc.

So I was able to conditionally remap TAB to RIGHT ARROW:
Code:
#IfWinActive, ahk_class SALFRAME
Tab::Right

But once I do that, I lose the default Windows ALT+TAB functionality from within Calc. So I was wondering if there's some way to maybe disable modifiers so that TAB only remaps to RIGHT ARROW when pressed by itself and not when pressed in conjunction with ALT. Thanks in advance!
Back to top
DevX



Joined: 07 Jan 2009
Posts: 43

PostPosted: Fri Jan 29, 2010 10:06 pm    Post subject: Reply with quote

You'll have to do it like this

Code:

#IfWinActive, ahk_class SALFRAME
Tab::
GetKeyState, CtrlIsDown, Ctrl
GetKeyState, AltIsDown, Alt
GetKeyState, ShiftIsDown, Shift

if ( (CtrlIsDown == "U") && (AltIsDown == "U") && (ShiftIsDown == "U") )
{
  Send, {Right}
  return
}
return
#IfWinActive
Back to top
View user's profile Send private message
juhu
Guest





PostPosted: Sat Jan 30, 2010 12:22 am    Post subject: Thanks! Reply with quote

Wow, you are a frickin' genius! I'm no slouch when it comes to programming but I just couldn't get it to work - this is great, thanks again!
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group