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 

Extending hotkeys for Win NT 2K XP

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Tue Mar 01, 2005 6:11 pm    Post subject: Extending hotkeys for Win NT 2K XP Reply with quote

It is possible to do for example : RControl & F12::Goto, Label01,
but it isn't possible to do : LShift & LControl & F12::Goto, Label02, or <+LControl & F12::Goto, Label03,
witch give an error.
I know that the help says :
Quote:
You can define a custom combination of two keys by using " & " between them.
, but i'd like to see this feature improved with the possibility to have a combination of 3 or 4 keys possible.
Perhaps too with the "double" notation possible (<+LControl, <+Control, !LControl, ^LShift, ...). I think <+LControl can be OK but not <+LControl & F12, for example...
May be I'm wrong but I tried at work on Win NT (4) and it didn't work (but no error was returned)
Is it possible (at least to increase the number of keys combination possible) ?
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue Mar 01, 2005 10:32 pm    Post subject: Reply with quote

When you're using normal modifiers (shift/alt/win/ctrl), you can have more than one as in this example:
+^F12::MsgBox You pressed Shift-Ctrl-F12

Or, to do the left keys specifically:
<+<^F12::MsgBox You pressed LeftShift-LeftCtrl-F12

In other cases, you can usually expand it to do more than two keys by using GetKeyState as in this example:
Code:

F10 & F11::
GetKeyState, State, F12
if State = D  ; F11 is also down.
    MsgBox You pressed F11 while holding down F10 and F12.
return
Back to top
View user's profile Send private message Send e-mail
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Wed Mar 02, 2005 5:07 am    Post subject: Reply with quote

Chris wrote:
When you're using normal modifiers (shift/alt/win/ctrl), you can have more than one as in this example:
+^F12::MsgBox You pressed Shift-Ctrl-F12

Yes it works perfectly but I want to do <+<^F12::MsgBox You pressed LeftShift-LeftCtrl-F12 witch don't work ... at my work (NT4 Rev 6) (I will re-verify at work - may be it's a bug - I will confirm after the work...).
But "LShift & F12" or "LControl & F12" for example are working.

I willl try your code at work in few hours (normally 2, as it is almost 6 o'clock in the morning in France at this time ...) and I thank you for it, but isn't more easy to be able to use "LShift & LControl & F12" than this code ? (If it isn't too much work for you to do that of course)
Thanks for your reply
Back to top
View user's profile Send private message
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Wed Mar 02, 2005 6:42 pm    Post subject: Reply with quote

I come back from work but I have my head elsewhere. I frogot to take the file where I wrote wy trys... I'll come back tomorow with news... I can say I seen some strange behaviours...
Back to top
View user's profile Send private message
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Thu Mar 03, 2005 6:54 pm    Post subject: Reply with quote

I come back with the result of my tests.
I must explain first that at the office I work on a Win NT4 rev 6 PC, essentially with a IBM/3270 Windows emulator from Attachmate, witch is called "Extra!" Vers 6.5 (there is a new version 8 witch is called MyExtra!, be we don't have it).
I have two little subroutines, one is called "keep" and do Ctrl-A then Ctrl-C to capture the screen of Extra! and then copy it in notepad. The subroutine "keepw" do the same, bu makes it's copy in Word...
For the results, I put "OK" when the result was ... OK, and "NO" when there was no result at all
Here are the results (sorry if it's too long) :

<+<^F12::Goto, keepw ; OK
<+>^F12::Goto, keepw ; NO
<+>^F11::Goto, keepw ; NO

<^F12::Goto, keep ; OK
>^F12::Goto, keepw ; NO

... The Right control key seems to not be handled...

F24::Goto, keepw ; NO
+F12::Goto, keepw ; OK

... I think F24 may work, but ... no

LShift & RCtrl:: ; NO
GetKeyState, State, F12
if State = D, Goto, keepw
return

... trying to hit 3 keys (with right contol) ... no way... (may be I don't do it well)

LShift & LCtrl:: ; OK
GetKeyState, State, F12
if State = D
Goto, keepw
return

we stay on the left, no problem

AppsKey & RWin:: ; AppsKey & RWin & F12 = launch Ct2f.exe !!!!! or send F12 alone !!!!
GetKeyState, State, F12
if State = D
Goto, keepw
return
#l::run, D:\...\Ct2f.exe

One of the more funy ones !!! the "#l" hotkey is launched (and no, I did't add the "return" afterwards....).

AppsKey & RWin:: ; OK
Goto, keepw
return

Twice keys on the right of the keyboard...

AppsKey & RWin:: ; NO
GetKeyState, State, F12
if State = D
Run notepad
return

Definitly don't like the right side of the ... keyboard ? I try to launch notepad (in this cas nothing special to do withe Extra!) with 3 keys (and right win) : nothing

AppsKey & LWin:: ; NO
GetKeyState, State, F12
if State = D
Run notepad
return

With 3 keys but LWin instead of RWin : no passaran !!!

AppsKey & RWin:: ; OK
Run notepad
return

AppsKey & LWin:: ; OK
Run notepad
return

With 2 keys, right or left, absolutely no problem

Et voilą, as the americans says !!!!

May be it was better to put this post in the bugs forum ????

I know it's a lot of information, Chris, but :
1) Is There a cure ?
2) Eventually witch one ?
3) Would it be ok if you implement (for the problem of 3 keys) what I asked for ?
4) Do you think it's a bug in the soft (AHK) or in the PC ?

Last but not the least, I use always the last version of AHK, so the 1.0.29.00 for the moment.

Thanks for your answer and your patience....


Last edited by Nemroth on Thu Mar 03, 2005 8:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Thu Mar 03, 2005 7:18 pm    Post subject: Reply with quote

Sorry it's me again !!!

I read in the "Mouse button combination" topic"
Chris wrote:
Although it might not be exactly what you want, here is an example that comes close:
Code:
~MButton & RButton::
GetKeyState, State, LButton
if State = U
    return
; Otherwise:
MsgBox You pressed the main three mouse buttons.
return
One drawback to the above is that you have to have LButton down prior to pressing the other two buttons.


And I didn't kow that, so in my examples at 3 keys I did exactly the opposite : F12 was the last key pressed. So is it perhaps for this reason that it didn't work well

But it seems more naturally for me to hit the two modifiers in first and F12 after that.

But Chris wrote :
Chris wrote:
There are probably ways to work around that.


Yeah !!! Witch ones ?

Chris wrote also :
Chris wrote:
I think the need for three-button combinations is fairly rare, but if anyone feels this is something common enough to go on the to-do list, please let me know.


So Chris let me explain why I think it's a good thing to have 3-key hotkeys

With a one modifier combination, I think you have few ways to distinguish differents hotkeys. I think that to have two modifiers + one key multiply the possibilities to "order" the hotkeys : hotkeys begining with LShift and LCtrl are for this type of action, those with RShift and LShift for an other type of action.

You can too imagine that "left sided hotkeys" are for a service in the office, and "right sided hotkeys" are for an other service, to avoid confusions, for example. I hope that I am understandable and that I can convince you....


Last edited by Nemroth on Thu Mar 03, 2005 8:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Thu Mar 03, 2005 7:51 pm    Post subject: Reply with quote

I think multiple-key hotkeys are a logical improvement, Chris. If I can get an intuitive design, I'll add it to my list.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Fri Mar 04, 2005 3:47 am    Post subject: Reply with quote

Nemroth wrote:
I didn't kow that, so in my examples at 3 keys I did exactly the opposite : F12 was the last key pressed. So is it perhaps for this reason that it didn't work well
I couldn't reproduce any hotkey misbehavior on XP, but it wouldn't surprise me if there are a few hotkey issues when running on NT4 since it is the oldest of the new-GUI NT kernels and farther away from Windows 2000 than 2000 is from XP. I you still see bugs, please post the examples so that others can try to reproduce them.

Nemroth wrote:
Quote:
you have to have LButton down prior to pressing the other two buttons.

There are probably ways to work around that.

Yeah !!! Witch ones ?
Something like this might be a little better:
Code:
Numpad1 & Numpad2::
Numpad2 & Numpad1::
KeyWait, Numpad3, D T1
if ErrorLevel
   return
Numpad3 & Numpad1::
KeyWait, Numpad2, D T1
if ErrorLevel
   return
MsgBox You pressed all three in any order.
returnI
I first tried it with the function keys but it appears that some or all keyboards to not like it when you press three function keys simultaneously (some of the events are never sent).

Quote:
let me explain why I think it's a good thing to have 3-key hotkeys
Most of the examples you gave seem to be for Control/Shift/Alt/Win, which already permit combinations of three or more keys.

jonny wrote:
I think multiple-key hotkeys are a logical improvement, Chris. If I can get an intuitive design, I'll add it to my list.
It seems simple at first glance, but there's already a lot of complexity behind two-key combinations (due to the nature of prefix and suffix keys, non-suppressed prefix keys [~], key-up hotkeys, etc.). I think allowing three keys in a combination would require a considerable amount of added design & code.

Edit: Changed it to "[NT4] is the oldest of the new-GUI NT kernels"


Last edited by Chris on Fri Mar 04, 2005 9:29 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Fri Mar 04, 2005 7:09 pm    Post subject: Reply with quote

I come back from work.
I tried :
Chris wrote:
Code:
Numpad1 & Numpad2::
Numpad2 & Numpad1::
KeyWait, Numpad3, D T1
if ErrorLevel
   return
Numpad3 & Numpad1::
KeyWait, Numpad2, D T1
if ErrorLevel
   return
MsgBox You pressed all three in any order.
returnI
I first tried it with the function keys but it appears that some or all keyboards to not like it when you press three function keys simultaneously (some of the events are never sent).


It works perfectly with left keys (I tried with in replacing Numpad1 by LCtrl, LAlt, Lwin) but with the right keys, the results are unpredictable (RWin, RCtrl...).

But the problem with this code is that Numpad1, Numpad2 & Numpad3 (when the 3 are used) are totally unusable alone.

I know Chris that you said :
Chris wrote:
It seems simple at first glance, but there's already a lot of complexity behind two-key combinations (due to the nature of prefix and suffix keys, non-suppressed prefix keys [~], key-up hotkeys, etc.). I think allowing three keys in a combination would require a considerable amount of added design & code.
but can you anyway think about that for a future improvement and to give it a place in the Planned Features (Not necessary in the top of the list, of course !!!) ?
Thanks by advance
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Fri Mar 04, 2005 9:26 pm    Post subject: Reply with quote

Nemroth wrote:
It works perfectly with left keys (I tried with in replacing Numpad1 by LCtrl, LAlt, Lwin) but with the right keys, the results are unpredictable (RWin, RCtrl...).
If you can post an example or two, it would help others with NT4 try to reproduce it. If I can get confirmation (since I think you said your NT4 systems were heavily customized), I will try to fix it.

Quote:
can you anyway think about that for a future improvement and to give it a place in the Planned Features (Not necessary in the top of the list, of course !!!) ?
I'll add it, but realistically it will be at least several months before it gets done unless someone else codes it.

Thanks.
Back to top
View user's profile Send private message Send e-mail
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Fri Mar 04, 2005 10:26 pm    Post subject: Reply with quote

Chris wrote:
If you can post an example or two, it would help others with NT4 try to reproduce it. If I can get confirmation (since I think you said your NT4 systems were heavily customized), I will try to fix it.
I will try on monday at work. I have to text some combinaisons in and out the IBM3270 emulator. And I will ask to a colleague I know who works in one of the computer services of my firm, perhops he know that.

Chris wrote:
I'll add it, but realistically it will be at least several months before it gets done unless someone else codes it.
It's an improvement that I will appreciate, but there is of course no emergency character. Thanks to put it in the planned features.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List 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