| View previous topic :: View next topic |
| Author |
Message |
xmav000
Joined: 15 Jun 2008 Posts: 10
|
Posted: Mon Jun 16, 2008 2:29 pm Post subject: [Solved] map Alt & Shift & Tab to ShiftAltTab? |
|
|
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 |
|
 |
PurloinedHeart
Joined: 04 Apr 2008 Posts: 209 Location: Canada
|
Posted: Mon Jun 16, 2008 5:17 pm Post subject: |
|
|
| Code: |
Shift & Alt & Tab::
|
I think that would work.
I'm not sure about your other question (the if-statement) |
|
| Back to top |
|
 |
xmav000
Joined: 15 Jun 2008 Posts: 10
|
Posted: Mon Jun 16, 2008 6:19 pm Post subject: |
|
|
| 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 |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1494
|
Posted: Mon Jun 16, 2008 6:37 pm Post subject: |
|
|
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 |
|
 |
xmav000
Joined: 15 Jun 2008 Posts: 10
|
Posted: Mon Jun 16, 2008 10:46 pm Post subject: |
|
|
| 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?  |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Tue Jun 17, 2008 2:39 pm Post subject: |
|
|
you have two modifiers
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
xmav000
Joined: 15 Jun 2008 Posts: 10
|
Posted: Wed Jun 18, 2008 2:16 pm Post subject: |
|
|
Thanks engunneer!
Now that we know whats wrong about [VxE]'s and PurloinedHeart's suggestions, can we find a solution that actually works?
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 |
|
 |
|