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 

[Solved] map Alt & Shift & Tab to ShiftAltTab?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
xmav000



Joined: 15 Jun 2008
Posts: 10

PostPosted: Mon Jun 16, 2008 2:29 pm    Post subject: [Solved] map Alt & Shift & Tab to ShiftAltTab? Reply with quote

Solved (hopefully) inspired by this
the {Blind} allows alttab and shifaltttab to work as expected
not sure about sideeffects yet.

ciao
xmav000

Code:

*tab::
    if ( GetKeyState("SC038","P") )
   {
      Send,{Blind}{AltDown}{tab}  ; We don't send AltUp because it drops the AltTab Menu
   }
   else if GetKeyState("#","P")
   {
      PriorDeadKey := "comp"
      CompKey := ""
   }
   else
   {
      send {blind}{Tab}
      PriorDeadKey := ""
      CompKey := ""
   }
return

*SC038 up::   
; We need to send this here because we don't want to send it in the Alt+Tab part but need it somewhere
   PriorDeadKey := ""   CompKey := ""
   send {blind}{AltUp}
return
   
*SC038 down:: 
; I believe this is needed for other shortcuts (in other programs) is it not?
    Send,{Blind}{AltDown}
   PriorDeadKey := ""   CompKey := ""
return




That question must seem real weird, but I'm having real trouble with ShiftAltTab.

I'm remapping all the keys for a new german keyboard layout (Neo2.0).

Currently we have the following code:
Code:

   if ( GetKeyState("SC038","P") )
   {
      SC038 & Tab::AltTab            ;
   }
   else if GetKeyState("#","P")
   {
      PriorDeadKey := "comp"
      CompKey := ""
   }
   else
   {
      send {blind}{Tab}
      PriorDeadKey := ""
      CompKey := ""
   }
return


We use Capslock + Tab for composing keys, e.g. capslock + tab (drop keys) then 'o' then 'c' will show the copyright symbol.

Now Alt+Tab works, but Shift+Alt+Tab does not work or goes into the same direction as Alt+Tab.
It drives me crazy.

I wanted to build in something like:
Code:
*Tab::
   if ( GetKeyState("LShift","P") and GetKeyState("LAlt","P") )
   {
      Shift & SC038 & Tab::ShiftAltTab
     ; MsgBox shift alt and tab
   }

But that is illegal, as there can only be two keys combined, not 3.

And why can I not assign hotkeys within an if-else statement.
e.g.:

Code:

mySwitch = 0
if (mySwitch)
{
  F5::MsgBox This should not be shown if mySwitch is 0
}


ciao
xmav000[/code]


Last edited by xmav000 on Sun Jun 22, 2008 1:50 am; edited 2 times in total
Back to top
View user's profile Send private message
PurloinedHeart



Joined: 04 Apr 2008
Posts: 209
Location: Canada

PostPosted: Mon Jun 16, 2008 5:17 pm    Post subject: Reply with quote

Code:

Shift & Alt & Tab::


I think that would work.

I'm not sure about your other question (the if-statement)
Back to top
View user's profile Send private message
xmav000



Joined: 15 Jun 2008
Posts: 10

PostPosted: Mon Jun 16, 2008 6:19 pm    Post subject: Reply with quote

Code:
Shift & Alt & Tab::MsgBox this does not work


Invalid hot key.

Was my question unclear or you are unsure about a solution?
ciao
xmav000
Back to top
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 1494

PostPosted: Mon Jun 16, 2008 6:37 pm    Post subject: Reply with quote

To turn hotkeys on/off or assign them dynamically, use the hotkey command. Note: you cannot assign code dynamically from within a script, it should be already written at a known label.
Code:
Hotkey, F5, F5, off
F6::Hotkey, F5, F5, % (mySwitch := !mySwitch) ? "on" : "off"
F5::msgbox This should toggle when you hit F6


I'm not sure how you would go about doing the shift-sc038-tab thing. What's wrong with <+<!Tab::ShiftAltTab ?
_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
xmav000



Joined: 15 Jun 2008
Posts: 10

PostPosted: Mon Jun 16, 2008 10:46 pm    Post subject: Reply with quote

Code:

<+<!Tab::ShiftAltTab

Even in an empty skript it says:
The Alt Tab hotkey "<+<!Tab" must have exactly one modifier/prefix

So can you tell me whats wrong about it? Smile
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Tue Jun 17, 2008 2:39 pm    Post subject: Reply with quote

you have two modifiers
Code:

<+
<!

_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
xmav000



Joined: 15 Jun 2008
Posts: 10

PostPosted: Wed Jun 18, 2008 2:16 pm    Post subject: Reply with quote

Thanks engunneer!
Now that we know whats wrong about [VxE]'s and PurloinedHeart's suggestions, can we find a solution that actually works? Smile

I need something that does the following:
If tab is pressed and caps or the # key is down do "something",
If tab is pressed alt is down send alttab
If tab is pressed and shift and alt are down send shiftalttab.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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