AutoHotkey Community

It is currently May 27th, 2012, 9:19 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: February 24th, 2006, 2:11 pm 
hi!

as you probably know, there exist usb devices that provide an external numerical block for notebooks.

now imagine using autohotkey to detect WHICH keyboard sent a keystroke: the "normal" keyboard OR the usb numerical block. this could turn the external numerical block into a low cost (~ 5 €) hotkey "board" having 17 freely definable hotkey buttons.

is this detection WHICH keyboard sent a keystroke possible with autohotkey?

thanks!

rh


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2006, 3:27 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
There's currently no built-in way to distinguish between multiple mice or keyboards. On Windows XP, there might be a way to do it using DllCall + RegisterRawInputDevices + OnMessage (OnMessage would be used to have the script receive WM_INPUT messages).

Although I have no experience with it yet, I plan to look into it someday.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2006, 3:33 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
You can try out the USB HID script I wrote for USB keyboards based on Micha's work to see if you can distinguish or even make hotkeys directly (only if the extra buttons are treated as special buttons which windows doesn't normally react to when the manufacturer's software isn't installed - so probably not in this case, unlike media keys on keyboards).


Warning: Not exactly simple to use but read the comments in the scripts and you should get some idea:
http://www.autohotkey.com/forum/viewtopic.php?t=7135


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2006, 5:50 pm 
Offline

Joined: February 13th, 2006, 10:40 pm
Posts: 389
Location: Utah
Interesting idea. I dislike the numeric pad that is on a laptops keyboard (its like diagonal and i always forget to take numlock off, and then as a i type words numbers come up) so i got used to using the numbers on top of the keyboard. Now if i had a external numpad i would use it as alot of hotkeys. In my case since i never use the 'numpad' (i use the 'numrow') i could simply have:

Numpad0::run, firefox
Numpad1::run, something
Numpad2::gosub, somefunction

etc.

This might work for you too.

You could also perhaps have someway of detecting the numlock state so that you can still use the numpad as a numpad if numlock is off. (rewrite pagedown to 3, right to 6, etc.) but i think that would mess up the normal keyboard too...

_________________
Image
"Power can be given overnight, but responsibility must be taught. Long years go into its making."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 24th, 2006, 6:01 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
That's a good point Veovis - if NumLock is off, then it would be safe to assume that a NumPad key must have come from the USB NumPad - or doesn't the usb NumPad send numbers if NumLock is off?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2006, 6:02 pm 
Offline

Joined: January 19th, 2006, 4:16 pm
Posts: 15
Location: Heidelberg
hi,

i just wanted to ask, if meanwhile there have been new developments concerning this question.

thanks!
rh


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 17th, 2006, 1:31 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Over at "more joystick axes/buttons", Aljaz sent me his DirectInput code that might be able to distinguish between multiple keyboards (i.e. that are all connected to the same PC simultaneously). However, he didn't have the time to implement it as a prototype DLL, and it might be 6 months or longer before I get to it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Can be useful
PostPosted: September 17th, 2006, 4:25 pm 
Offline

Joined: December 20th, 2005, 4:15 am
Posts: 165
Location: Malaysia
I actually make use of this "limitation". In fact, it's a useful feature for me. I have one of those laptop keypads hooked up to my desktop. I use it for games and it is placed on the left of my main keyboard.

I have various scripts assigned to the numpad keys, so now it is really easy to activate them with my left hand - I don't need to reach across to the right side of the keyboard, nor do I need to let go of the mouse. Since AHK doesn't care which keyboard I use, either numpad would work.

Incidentally, you can get them really cheap from eBay; just search for "numeric keypad" or "laptop keypad". Your local computer store may also stock them.

As for getting more hotkeys, have you tried Custom Combinations yet?
You can do stuff like:

Code:
Numpad0 & Numpad2::Run Notepad


So even the 17 keys on the numpad can generate lots of different combinations.

Chris wrote:
There's currently no built-in way to distinguish between multiple mice or keyboards. On Windows XP, there might be a way to do it using DllCall + RegisterRawInputDevices + OnMessage (OnMessage would be used to have the script receive WM_INPUT messages).

Although I have no experience with it yet, I plan to look into it someday.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Google Feedfetcher, migz99 and 68 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group