Need help my script acts as a toggle

Get help with using AutoHotkey and its commands and hotkeys
knut55
Posts: 3
Joined: 28 Aug 2017, 02:40

Need help my script acts as a toggle

28 Aug 2017, 02:53

Okay so I'm in dire need of some help ith my script. Now my laptop keyboard is missing the Alt gr key and so I want my right Alt key to simulate a Ctrl + Shift combination. To use some symbols on my number row I have to hold down Ctlr + Shift at the same time and then press on 1,2,3...0 key. Now I got this script but it seems to work more like a toggle. I just press Left Alt once and it is held forever it seems, very odd. What I want is to have Ctrl ánd Shift held as long as I myself holds down the Left Alt key. This is my code:

Code: Select all

RAlt::
	Send, {Ctrl down}{Alt down}
Return
I'm very sorry if this is a studpid question but I just can't find the answer to this one.
Helgef
Posts: 4461
Joined: 17 Jul 2016, 01:02
Contact:

Re: Need help my script acts as a toggle

28 Aug 2017, 03:44

Hello and welcome. Try this,

Code: Select all

*RAlt::Send {Ctrl down}{Shift down}
*RAlt up::Send {Ctrl up}{Shift up}

Edit:
knut55 wrote: EDIT: Don't know if my machine was slow or what but now it works. Thanks alot!
Happy days! You are welcome. :thumbup:
Last edited by Helgef on 28 Aug 2017, 05:10, edited 1 time in total.
knut55
Posts: 3
Joined: 28 Aug 2017, 02:40

Re: Need help my script acts as a toggle

28 Aug 2017, 05:03

Helgef wrote:Hello and welcome. Try this,

Code: Select all

*RAlt::Send {Ctrl down}{Shift down}
*RAlt up::Send {Ctrl up}{Shift up}

I tried this but with

Code: Select all

*RAlt::Send {Ctrl down}{Alt down}
*RAlt up::Send {Ctrl up}{Alt up}
Still is the same result.

EDIT: Don't know if my machine was slow or what but now it works. Thanks alot!

How do I do the same thing but with two keys at the same time? That is: I want to simulate the Alt Gr key with two other keys on the left side. The funny thing is that the following script works on my english laptop keyboard but not on my Swedish usb keyboard it atcs as an toggle:

Code: Select all

LAlt & f::Send {Ctrl down}{Alt down}
LAlt & f up::Send {Ctrl up}{Alt up}
If I look on the AHK window on my laptop I can see that the down and up commands are fired but on my pc with usb keyboard only the down keys are fired.
I Also tried just remapping the number keys directly like this:

Code: Select all

Alt & 2:: 
	Send, @
Return

Alt & 3:: 
	Send, £
Return
But it does nohting. Not even this works:

Code: Select all

2:: 
	Send, @
Return
This still prints '2' when I hit the 2 key. Shouldn't it print @ instead?
Is there some special code when using the number row?
obeeb
Posts: 140
Joined: 20 Feb 2014, 19:15

Re: Need help my script acts as a toggle

28 Aug 2017, 18:16

knut55 wrote:

Code: Select all

2:: 
	Send, @
Return
This still prints '2' when I hit the 2 key. Shouldn't it print @ instead?
Try with numpad2:: if that doesn't work find out the scan code of the key https://autohotkey.com/docs/KeyList.htm#SpecialKeys and try with it.

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKNoobie, boiler, Googleye, hasantr, mikeyww, MosheMadula, Xeo786 and 58 guests