Hi Guys,
I've recently discovered this tool and it would really help me if I could get it working on my end.
I have been trying to understand how the code works but it kept failing. I am not tech savvy, and coding is simply beyond my knowledge.
So, what I'm trying to do is, I'd like to create a hotkey for this combination: CTRL + ~
I'd like to assign this combination with the tilde key. So when I press tilde, it would perform the combination above.
Any help is truly appreciated.
Thanks,
Elaine
Basic Script
-
- Posts: 3
- Joined: 10 May 2019, 02:30
Re: Basic Script
Welcome to AHK!
Do you get any other hotkey to work?
Do you have tried to solve this with some AHK code? (Can you show us that code?)
Do you get any other hotkey to work?
Do you have tried to solve this with some AHK code? (Can you show us that code?)
Re: Basic Script
On my PC, the # key, has ~ as the secondary character.
So for me, the ~ key, is really the # key.
So I'd do this:
$#::SendInput, ^{#}
$ is to prevent the key sending itself in an infinite loop.
So for me, the ~ key, is really the # key.
So I'd do this:
$#::SendInput, ^{#}
$ is to prevent the key sending itself in an infinite loop.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Basic Script
(It can be a problem with, for example, "~" on different keyboards)
If we see how ElaineTheSorceress has tried to solve its hotkeys, there may be other problems that appear.
If we see how ElaineTheSorceress has tried to solve its hotkeys, there may be other problems that appear.
-
- Posts: 3
- Joined: 10 May 2019, 02:30
Re: Basic Script
Thank you for all your help with this.
Unfortunately, it didn't work.
I copied the code and compiled it.
I am using version 1.1.30.03 if that helps. I am going to use this for Zendesk Chat, they have assigned a keyboard shortcut which is CTRL + ~
I am thinking of remapping it to tilde key.
Unfortunately, it didn't work.
I copied the code and compiled it.
I am using version 1.1.30.03 if that helps. I am going to use this for Zendesk Chat, they have assigned a keyboard shortcut which is CTRL + ~
I am thinking of remapping it to tilde key.
Re: Basic Script
Send some lines of your code, what you're trying to do, maybe we can help you a little bit more.
-
- Posts: 3
- Joined: 10 May 2019, 02:30
Re: Basic Script
Hi, what I initially did was read the documentation and did my best to create the code.
So, I came up with this,
Code: Select all
Sc029::^~
Code: Select all
Sc029::^~
return
Re: Basic Script
Can the link below help you?
Can remap SC029 but not SC079 ??
or Remapping Keys
I don't know what you want to do with the sign combination Ctrl + ~
"~" (tilde) is a special sign. Tilde cannot stand alone, more characters must be present for activate tilde.
eg. On my keyboard
AltGr + ~ + n => ñ
or
AltGr + ~ + (space) => ~
On my PC SC029 is § (GetKey)
Because I don't know how to test ^~, I have to try something similar.
There are three things that need to be checked.
1) Which character should be captured? Tested the following three methods (which all works on my computer)When the paragraph character key was pressed - the tilde was displayed in Notepad (if notepad was the active window)
2) What should the result be? The following example opens Notepad, writes a text (on latin). When § is pressed, the text is cut out to the ClipBoard.
3) Some AHK programs must run as an administrator to work!
This can be done in three ways (which I know)
3a) Right-click on the AHK program and choose run as administrator - this is the easiest way.
I usually forget to run these AHK programs as administrator, which makes me frustrated...
3b) In the ahk code you can automate this. (From AHK-Run help)for exampleOne disadvantage is that the UAC window always open,s and asks if this is what you want to do.
3c. This method is the most complicated (and I'm not going to describe this now)
By running the AHK program as an administrator, through the Task Scheduler in Windows, no question arises about UAC. (I have no other idea how to solve this)
Maybe anything of the above can be helpful for you?
Can remap SC029 but not SC079 ??
or Remapping Keys
I don't know what you want to do with the sign combination Ctrl + ~
"~" (tilde) is a special sign. Tilde cannot stand alone, more characters must be present for activate tilde.
eg. On my keyboard
AltGr + ~ + n => ñ
or
AltGr + ~ + (space) => ~
On my PC SC029 is § (GetKey)
Code: Select all
; Show information for a specific key.
key := "sc029" ; Any key can be used here.
name := GetKeyName(key)
vk := GetKeyVK(key)
sc := GetKeySC(key)
MsgBox, % Format("Name:`t{}`nVK:`t{:X}`nSC:`t{:X}", name, vk, sc)
There are three things that need to be checked.
1) Which character should be captured? Tested the following three methods (which all works on my computer)
Code: Select all
Run Notepad.exe
$§::SendInput, {~}{Space}
; $SC029::SendInput, {~}{Space}
; $§::Send {~}{Space}
2) What should the result be? The following example opens Notepad, writes a text (on latin). When § is pressed, the text is cut out to the ClipBoard.
Code: Select all
#Persistent
#SingleInstance force
TestString = Lorem ipsum dolor sit amet, consectetur adipisicing elit, ...
Run Notepad.exe,,, NotepadPID
WinWaitActive ahk_pid %NotepadPID%
ControlSend, Edit1, %TestString%, ahk_pid %NotepadPID%
$§::
WinActivate ahk_pid %NotepadPID%
SendInput ^a
SendInput ^x
Return
This can be done in three ways (which I know)
3a) Right-click on the AHK program and choose run as administrator - this is the easiest way.
I usually forget to run these AHK programs as administrator, which makes me frustrated...
3b) In the ahk code you can automate this. (From AHK-Run help)for example
Code: Select all
#Persistent
#SingleInstance force
StartAsAdmin()
TestString = Lorem ipsum dolor sit amet, consectetur adipisicing elit, ...
Run Notepad.exe,,, NotepadPID
WinWaitActive ahk_pid %NotepadPID%
ControlSend, Edit1, %TestString%, ahk_pid %NotepadPID%
$§::
WinActivate ahk_pid %NotepadPID%
SendInput ^a
SendInput ^x
Return
StartAsAdmin()
{ full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{ try
{ if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
}
3c. This method is the most complicated (and I'm not going to describe this now)
By running the AHK program as an administrator, through the Task Scheduler in Windows, no question arises about UAC. (I have no other idea how to solve this)
Maybe anything of the above can be helpful for you?