How to send Control / in AHK - automation

I'm trying to send Control Forward Slash at one time in an AHK script.
I've tried:
Send ^{/}
Send ^/
Send {Ctrl Down}/{Ctrl Up}
I've also tried SendInput instead of just Send.
None of them are working. I'm wanting to go to the search bar in the program my company uses but I can't get Control + Forward Slash to work

Explain what you want to do and what should be accomplished by your code.
Are you asking how to send those characters to text, or how to emulate the pressing of those characters on your keyboard - like sending a hotkey?
^/ works just like that as a hotkey trigger on my std US keyboard (the / being the unshifted ? key).
If you are trying to send it as literal text, it is the control key ^ you have to escape. So:
Send {^}/
would type it out as ^/
Using Send ^/ has the effect of whatever pressing control-slash is supposed to do. For me, that's nothing special except in apps that map it to something. If you want it as a hotkey and to refer to it in other parts of your code, give it a subroutine name as well, and just call it when needed.
my_subroutine:
^/::
MsgBox Hello World
return
. . .
gosub my_subroutine

Related

Capture barcode scan when minimized

I'm dealing with a barcode scanner that acts as a keyboard emulation.
I print my barcode labels with a custom heading character (pipe) .
In my main form, I listen to the keypress event and as soon as I see the custom header character, I start receiving the scan and than do my stuffs.
This method works pretty well if my application is focused but can't do nothing if the application is minimized or unfocused.
I tried to setup a keyboard hotkey. It partialli works: my application get focused on the first character but is not fast enought to capture the subsequent characters spitted very fast from the scanner.
Any idea on how to capture this keystrokes with the application unfocused?
Obviously if the heading char id detected the subsequent characters must be suppressed until the sequence is completed with a vbcr or a timeout is reached.
Note that the scanner spits a sequence of 15 characters in less than a tenth of a second
This is how Windows works, only the active application will handle keyboard input. Thus, when your application is minimized, it will not receive or handle any keyboard input.
As Bradley Uffner commented, you need a global keyboard handler, I've used this in the past and it works quite well. Basically a system wide listener that will handle keyboard input even while minimized.

Escape flash load of Cisco Autonomous AP from Expect script

I am trying to use a expect script to stop the loading of the flash on a Cisco Autonomous AP so that I can get into the rommon.
Loading "flash:/ap3g1-k9w7-mx.124-25d.JA/ap3g1-k9w7-mx.124-25d.JA"...###
If you are sitting a keyboard pressing the escape key at this point will stop the process and give you the option to abort and put you to a rommon prompt.
With the expect script I have tried:
Sending an escape
send "\x1B"
this is sending the hex value for Esc. This is ignored and the process continues. However this works on a WLC device so I know the value is valid.
Sending a break
send "\x1D"
expect "telnet>"
send "send Break\r"
this is sending the hex value for Ctrl+] which is the escape character for but it puts it to telnet> prompt. Sending the break comes back from the telnet and continues loading the flash. On another device that stops the load and puts the device in rommon.
I have also tried the hex for the F1 key and for an arrow key because those work from the keyboard also.
The send "\x1B" will work on an AP as long as the device is set up to allow password recovery.

Auto Hot Key - Holding down one key holds down 2 different keys

So I've used AutoHotKey to disable the AppsKey (the button on the keyboard which brings up the right-click menu). But I thought I could put it to better to use, and am trying to get it so that while I'm holding down the AppsKey the computer thinks I'm holding down Shift & Control instead.
I've been reading through the Command List but can't see anything for AppsKey down & up. Would anyone be able to share anything to enable me to do this?
Thanks
I don't understand what your problems are, but this little piece of code works for me:
AppsKey::Send, {SHIFT down}{CTRL down}
AppsKey up::Send, {CTRL up}{SHIFT up}
As you can see, there is an AppsKey up. Down on the other hand doesn't exist for hotkeys. In this example, the first hotkey triggers when AppsKey is pressed (that is, it triggers as soon as you hit it). The second hotkey triggers when it is released.

How to send the "#" symbol with NirCmd sendkeys

Using NirCmd sendkeys functions, I am trying to send the # symbol to firefox to automate logins that contain my email address but can't seem to find the right code for the # key. Any help is appreciated.
A normal keyboard don't have the # key.
Maybe you could try sending SHIFT and 2 at the same time.
However, I think AutoHotKey is more suitable for this kind of task.

Remap hotkey without losing native hotkey functionality

I want the keyboard shortcut ctrl+tab to perform two functions:
ctrl+tab (its normal function, e.g., to switch tabs in a web browser)
ctrl+F6 (which can be used to switch between Microsoft Word documents, for example)
It doesn't need to be context-sensitive, i.e., it's okay to send both commands regardless of what program(s) I am using. The closest I have come is the following:
~^Tab::^F6
which performs both of the desired functions, but a "Tab" keystroke is also sent along with the hotkey. (This would wreak havoc on my Word documents!) I need to preserve the native ctrl+tab functionality without sending a Tab keystroke. Could someone please help?
Then just send both commands:
$^Tab::
Send, ^{F6}
sleep,50
Send, ^{Tab}
return
Just note that some programs might not like that.