simple script

Get help with using AutoHotkey and its commands and hotkeys
radio joe
Posts: 2
Joined: 31 Jul 2020, 17:32

simple script

31 Jul 2020, 18:02

New member. Hope this is the way to ask question. Using the following script (w/o quotes) "Numpad1::Send #1" trying to send key strokes Window key followed by the number 1 when Numpad "1" key is pressed. Numlock is on. Tried many variations but no joy. . Any help would be appreciated. Thanks
rommmcek
Posts: 1046
Joined: 15 Aug 2014, 15:18

Re: simple script

31 Jul 2020, 18:23

Your code line works for me. Try Numpad1::Send #{1} if it makes any difference!
gregster
Posts: 4912
Joined: 30 Sep 2013, 06:48

Re: simple script

31 Jul 2020, 18:29

Generally, it should work.
If you want to send to a program that runs with elevated rights, try to run your script 'as admin'.
If the target program is a game, there might be other isssues...
radio joe
Posts: 2
Joined: 31 Jul 2020, 17:32

Re: simple script

31 Jul 2020, 19:34

I have an 8 port KV box, It is like a KVM but only the K and M. Using USB mouse and keyboard. The problem is the box has one button to go thru the ports sequentially. Pressing and holding the WIN key while pressing 1 through 8 does select the associated PC. I wanted to use an autohotkey script on each PC to select other PC's by pressing a numpad key 1 thru 8. PC's are windows 10. (only have 6 pc's connected.). I have only tried script on one PC. I guess my next step is to try loading it on other PC's. Maybe something odd about PC I am using to test. You never know about Windows OS.
braunbaer
Posts: 79
Joined: 22 Feb 2016, 10:49

Re: simple script

01 Aug 2020, 02:50

This is not possible.
Using the send command (or any other AHK command) does not physically press a key, it produces windows messages to simulate key presses within the computer.
Only if you physically press that key combination, it gets into your box and triggers a port change there. There is no way to simulate a key press to external hardware.

Return to “Ask For Help”

Who is online

Users browsing this forum: djuga, mikeyww, Reeyan283, tatagi and 27 guests