Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

3 keys binding 1 command



  • Please log in to reply
2 replies to this topic
MatKey
  • Members
  • 2 posts
  • Last active: Nov 01 2015 03:26 PM
  • Joined: 28 Oct 2015

Hi all,

 

I would like to do the following with one single *.ahk script:

 

1.) when I press the combination AltGr+e+3 it types a 'ê' character

2.) the current function of AltGr+e (it types a 'Ä' character) remains the same

3.) the current function of AltGr+3 (it types an invisible '^' character, but displays it after hitting space or any other letter, and for some letters it puts a circumflex above them, like 'ô')

 

So basically I would like to be able to type this 'ê' character with the AltGr+e+3 keybinding without making any disturbances to anything that already pre-exists.

 

So far I wrote this script:

 

RAlt & 3::
        If GetKeyState("e","p")
        Send, ê
Return

 

but it types this: ĂŞ instead of this: ê

and also, I can't use the '^' character like normally.

 

Can you please show me the solution for this?

 

Thank you in advance!!! :)

 

Mat



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Try doing this:

 

$>!3::
If GetKeyState("e","p")
Send ê
else
Send >!3
return

 

And also change your script encoding (in your text editor) to UTF-8 and use the Unicode version of AHK. If you don't, an alternative is to use Send % Chr(234) instead of Send ê



MatKey
  • Members
  • 2 posts
  • Last active: Nov 01 2015 03:26 PM
  • Joined: 28 Oct 2015
✓  Best Answer

Thanks man!

 

After all, I had to change the code to this, but now it works perfectly!

 

RAlt & e::
If GetKeyState("3","p")
Send ê
else
Send >!3
return