3

A few days ago I bought Microsoft designer keyboard

https://www.microsoft.com/en-us/d/microsoft-designer-compact-keyboard/8zhrtr7zcswq?activetab=pivot:overviewtab

it has emoji key but it's not useful at all... so I decide to change it to ctrl and the only application that I think can do it is AutoHotkey

When I check view -> key history and script info and I press emoji key I can see all these lines added:

A2  01D     d   3.08    LControl        
A0  02A     d   0.00    LShift          
A4  038     d   0.00    LAlt            
5B  15B     d   0.02    LWin            
20  039     d   0.00    Space           
20  039     u   0.09    Space           
A2  01D     u   0.00    LControl        
A0  02A     u   0.00    LShift          
A4  038     u   0.00    LAlt            
5B  15B     u   0.00    LWin 

so I wrote this script but it's not working properly...

$~*<^<+<!<#space:: ; this line means: LControl+LShift+LAlt+LWin+Space
Send,{ctrl}
return

After running this script, every time I press the emoji key, Microsoft Office will be open. so this script is not working...

help me to get rid of this emoji key... I need the ctrl key.

please write if you know any other application or any other way that I can convert emoji key to ctrl`.

Raskul
  • 1,674
  • 10
  • 26
  • 2
    This line looks truly horrendous `$~*<^<+<!<#space::`, what is it supposed to do? Anyway, for a solution, try to see if you can get the key's VK or SC and make a hotkey based off that. See [this](https://www.autohotkey.com/docs/KeyList.htm#SpecialKeys) documentation page for help. – 0x464e Oct 20 '21 at 13:57
  • @0x464e I update my question.... there is not one VK or SC or emoji key... when I press it I can see 10 lines added... – Raskul Oct 20 '21 at 17:02
  • Ok, I see now. I posted an answer that might be of some help. – 0x464e Oct 20 '21 at 19:18

4 Answers4

3

Ok, seems your emoji key is implemented via sending Office Key+Space.
And the office key is implemented via the key combination LCtrl+LShift+LAlt+LWin.
Pressing (and releasing without any other keypress in-between) the office key alone takes you to https://www.office.com/?from=OfficeKey. You want to disable this behavior. Otherwise that website will get launched every time. Would make your remap pretty bad.
According to this answer, you can disable it via a registry change.

After that, you should be able to remap Office Key+Space to something better:

^+!#Space::MsgBox, % "Hello!"

To properly remap to Ctrl, you need to take the down & up events into consideration.
This might do it:

^+!#Space::SendInput, {Ctrl Down}
^+!#Space Up::SendInput, {Ctrl Up}

But really I'm not sure. I don't have an office key, so I'm reluctant to make that registry change and try go figure it out more.

0x464e
  • 5,948
  • 1
  • 12
  • 17
3

for future visitors, I want to put the correct answer here because the correct answer is the combination of the two above answers thanks to 0x464e and spyre I can't say one the answers is the correct so I just vote up both posts.

first, we should download Microsoft's Mouse and Keyboard software and remap emoji key to application key (what is application key)

after that, we should add these lines of code to AutoHotKey

AppsKey::SendInput, {Ctrl Down}
AppsKey Up::SendInput, {Ctrl Up}

and now emoji key works exactly like ctrl and the combination like ctrl + a will select all the text.

thank the StackOverflow community. I can't imagine life without YOU.

Raskul
  • 1,674
  • 10
  • 26
  • 2
    Is that software not able to just remap it straight to `Ctrl`? Weird piece of software if it lets you remap to `AppsKey` but not `Ctrl`. But well, what do I know, maybe there's a good reason, I don't know how that software interfaces with those Microsoft keyboards. – 0x464e Oct 21 '21 at 00:10
  • No there are just 3 options for Emoji key:1- emoji 2- office 3- application key – Raskul Oct 21 '21 at 09:44
  • 1
    Ok, well maybe they have some reason for it. Also, as a side note, there's no reason here to use a scan code hotkey, you can just use the key name `AppsKey`. (`AppsKey::` and `AppsKey Up::`) – 0x464e Oct 21 '21 at 13:13
2

This looks like something you would be able to edit from Microsoft's Mouse and Keyboard software.

I personally have used it to remap the special keys on my Microsoft Comfort Curve Keyboard- it should be very similar for the other models of keyboards they manufacture.

Feel free to let me know if you need more specific instructions to change the function of the emoji keys to fit your needs.

Spyre
  • 2,234
  • 1
  • 4
  • 24
2

I read all the answers and all the comments but the only thing that helped me to disable my Emoji key was this code:

AppsKey::SendInput, {Ctrl Down}
AppsKey Up::SendInput, {Ctrl Up}
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
supperman
  • 21
  • 1