Create "Fake keys" that the computer interprets as real?

Explanation

Alright, so this is a photograph of the general layout of a keyboard.

What I'm wondering is: Is it possible to emulate extra keys on a keyboard other than the standard keys? For example, I could trick my computer into thinking that my keyboard also has 3 extra keys labeled FK1, FK2, and FK3.

These extra three keys wouldn't be letter keys, like Home, Insert, Page up, etc.
Basically they would do nothing, unless assigned to do something. For example if I set a hotkey in a program to use FK1, it would register it.

Why?

I'm glad you asked. I play a game called ArmA 3 a lot, and those of you who are familiar with the game know that it uses up just about every key on the keyboard.
To communicate with my mates in this game I use TeamSpeak. I have a soundboard for teamspeak, and I want to be able to activate different sounds using hotkeys instead of alt-tabbing and clicking, but there's virtually no free keys left in ArmA with all the mods I use.

Even if you could create these "fake keys", how would you use them In-game if they aren't on an actual keyboard?

Excellent question.
My keyboard is a Logitech G910 Orion Spark, which has 27 macros on it. I'm assuming I can set each of these macros to call on the fake keyboard buttons during use.

This is probably extremely confusing to read, but I did my best.

Windows 10 Pro (x64)

3

2 Answers

When you press a key on your keyboard, the hardware generates a 'scan code', which software then interprets as a certain key press.

Key reassignment

KeyTweak allows you to reassign the key press that Windows interprets from each scan code by adding appropriate Registry entries.

Unfortunately, it doesn't allow you to add additional fake keys. The closest it gets is allowing reassignment of the media/web control keys that some keyboards have. It also doesn't let you assign key codes that your keyboard doesn't normally use. So if you have a US keyboard, it won't let you assign Ó or £. So you would still be limited to using the normal key letters, which you say you've exhausted.

Faking it

AutoHotkey allows scan codes and unusual symbols to be generated by scripts.

This script generates £ whenever Win+p is pressed (I got the symbol off the internet, and pasted it into the text editor I was using to create the script):

#p::
send, £

Depending on your game, you might be able to use a script like this to get £ as a key in your game. But, if the game is waiting on actual keyboard scan codes to be generated, this won't work. It depends on how the game interacts with hardware.

Luckily, AutoHotkey can also generate keyboard scan codes. This script will generate a Space when Win+p is pressed, because scan code 39 (hex) is space (see Scan Code List).

#p::
send, {sc39}

AutoHotkey also has another method for generating Virtual Keys. I haven't researched the difference, but this script will generate space using a virtual key when pressing win+p:

#p::
send, {vk20}

This reference lists all the Virtual Key codes, including many non-standard keys that you won't have used yet:

You could try to create a script that sends a non-standard Virtual Key to your game. If the game registers it and lets you save it in its keyboard set up page, the you are probably going to get this to work.

The last piece of the puzzle is getting the Logitech macros to call the AutoHotkey script that generates the Virtual Key. You'd create an AutoHotkey script without a hotkey, so it fires straightaway when run - such as

send, {vk7B}

or

send, £

Associate *.ahk files with the Autohotkey program, and then get the Logitech macro to open the saved script.

Note: I haven't tested this in any games. It will likely have different results in different games - depending on what they accept as valid entries. In the Virtual Keys link above, people are discussing doing almost exactly what you want to do, and seem to have had some success with using F13-F24 keys, so maybe try those first.

vk7B sc58 F12
vk7C sc64 F13
vk7D sc65 F14
vk7E sc66 F15
vk7F sc67 F16
vk80 sc68 F17
vk81 sc69 F18
vk82 sc6A F19
vk83 sc6B F20
vk84 sc6C F21
vk85 sc6D F22
vk86 sc6E F23
vk87 sc76 F24

EDIT:As requested in comments; a simple script to create F13 could look like:

b::
send, {vk7C}

Every time you hit 'b' while this script is active (in your tray near the clock), F13 will be sent. This script will stay active and run every time you hit 'b' until you kill it. Once the game registers F13 in key set up, kill this script, and make one like this for Logitech to call:

send, {vk7C}

This one won't stay active, it will run once and then end, each time it is called.

4

Apologies for the late response. I had a need to access the function keys past F12, something current keyboard manufacturers don't seem to account for, but easy enough with AutoHotkey. I've used this to add these keystrokes as macros to my mouse, which doesn't support adding arbitrary keys otherwise.

z::
send, {F13}
return
x::
send, {F14}
return
c::
send, {F15}
return
v::
send, {F16}
return
b::
send, {F17}
return
n::
send, {F18}
return
m::
send, {F19}
return
l::
send, {F20}
return
k::
send, {F21}
return
j::
send, {F22}
return
h::
send, {F23}
return
g::
send, {F24}
return

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like