Jump to content

Can I Hotkey Keys That Aren't On My Keyboard?


Recommended Posts

I want to map buttons that are not on my keyboard to buttons on my keyboard so I can use them to set bindings and then change which physical keys on my keyboard.

For example Say my keyboard has 101 keys....if all the keys are set to identities like in alt codes then i want to emulate a key 102 103 104 105 106

Then I set binding to 102

It has no physical presence on the keyboard

but then I create hotkeys that trigger those keys.

This way I can press one hotkey which can remap all my keys into a different pattern on the fly.

I'm having a hard time explaining this. It would be easier to show you but alas...

Link to comment
Share on other sites

I want to map buttons that are not on my keyboard to buttons on my keyboard so I can use them to set bindings and then change which physical keys on my keyboard.

For example Say my keyboard has 101 keys....if all the keys are set to identities like in alt codes then i want to emulate a key 102 103 104 105 106

Then I set binding to 102

It has no physical presence on the keyboard

but then I create hotkeys that trigger those keys.

This way I can press one hotkey which can remap all my keys into a different pattern on the fly.

I'm having a hard time explaining this. It would be easier to show you but alas...

That doesn't make much sense to me, but maybe you need something like key tweek.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

That doesn't make much sense to me, but maybe you need something like key tweek.

It doesn't make much sense to me, either. Let me try to explain it in another way...

Logitech has a keyboard called the G15. On this keyboard it has several 'extra' buttons that are not on a regular US keyboard.

I want to emulate new keys.

$a = ALT105
$b = ALT106

HotKeySet("a", "KeyA")
HotKeySet("b", "KeyB")

Func KeyA() 
Send($a)
EndFunc

Func KeyB()
Send($b)
EndFunc

While 1
Sleep (10)
WEnd

Assume that ALT105 and ALT106 thing actually had meaning -- it linked to an emulated key that is not on my physical keyboard. Thus, when I hit the 'a' key on my keyboard it doesn't push a but that 'ALT105' emulated key.

Please ask questions, I could probably explain this better by answering questions than by talking about it.

Link to comment
Share on other sites

That doesn't make much sense to me, but maybe you need something like key tweek.

Key Tweak is sort of what I need. Except, I don't need to swap keys on my keyboard so much as I need to be able to set them to virtual keys (keys that aren't physically on my keyboard) and I need to be able to do this through an autoit script so I can hook it into the rest of my project.

Link to comment
Share on other sites

I'm afraid it won't work the way you want. I have G15 on several machines here, mostly for their "extra keys", not for gaming. For those who don't know, the G15 has keys G1..6 and three modes M1..3. Each combination can be assigned a programmable key sequence and you can program a different sequence for every program of your choice. For instance, I can program mode 2 of function key G5 to emit "Welcome to the AutoIt forum!" when the active program is FireFox, but emit a complex sequence of cursor, function and text keys when the active application is xyz.exe

These "extra keys" are specific to the G15 and they work together with the Logitech support, which works at pretty low-level as it handles make and break codes.

For istance, Au3Recorder doesn't see them, the scan codes for those keys don't seem to exist at all (they work at the keyboard level and only with the Logitech driver). Au3Recorder only catches the sequence that has been assigned to a key, not the make / break code for the G-key itself.

That is if you wanted to emulate a G15, or sort of: no.

Now if your question is about mapping keys to characters that don't exist on your physical keyboard, yes that's possible. But $a = ALT105 just doesn't mean anything in AutoIt. If you mean to enter a compose sequence, make it Send("{ALTDOWN}0105{ALTUP}") to emulate composing the lowercase I letter. You may use the simpler Send("i") or Send("{ASC 105}") to the same effect. Use Send("{ASC 0x2643}") to emit a 'Jove' character (U+2643 = ), which I'm pretty sure doesn't exist more on your keyboard than on mine. You can use Send(ChrW(0x2643)) or Send("") as well. Note that this character may not display in the font you use, that's just an exotic example.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

I thought this might work so I gave it a shot.

Apparently the Send(("{ASC 0229")) (or any alt code) actually sends alt+0229 to the keyboard.

The problem with this is in the program I am trying to rebind it sets the hotkey to "alt + numpad 0"

Is there a way to do this on a lower level?

Link to comment
Share on other sites

I don't know enough of Windows internals at this level to give you hints. Alt + numpad digits are special in that they are used by Windows itself to compose scan codes, typically used for typing characters not present on the physical keyboard. By itself, Alt + num0 composes nothing AFAICS.

I'm afraid you would need going down to driver-level to intercept things the way you want, and that would be likely to interfere with Windows behavior if you don't adhere to Windows rules. Certainly some other contributor knowing better than me could help you better.

BTW, what are you trying to achieve?

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

I don't know enough of Windows internals at this level to give you hints. Alt + numpad digits are special in that they are used by Windows itself to compose scan codes, typically used for typing characters not present on the physical keyboard. By itself, Alt + num0 composes nothing AFAICS.

I'm afraid you would need going down to driver-level to intercept things the way you want, and that would be likely to interfere with Windows behavior if you don't adhere to Windows rules. Certainly some other contributor knowing better than me could help you better.

BTW, what are you trying to achieve?

I don't want to mess with my drivers. I'm certainly not that tech savvy.

There is a game called Darkfall and it's interface is really....clunky. I'm trying to customize it to my liking. So when I am casting magic I'd like the keys on my keyboard match up with the hotkeys for spells and when I'm using melee I'd like the keys on my keyboard to match up to melee attacks.

Basically, I'm trying to find innovative ways to save keyboard real estate. In the game if I bind fireball to shift+e then I can't bind anything else to shift+e and it's a really nice button to use.

By setting hotkeys in AutoIt I have been able to bind several combat moves to one keystroke, so my shift+e can do fireball or disabling blow or lean right. The problem is there are only so many keys on the keyboard I can use for binds before I get into the shift+ and alt+ and control+ combinations which are not good to use because if I use one of them and hit the key while pressing it, it will get the key stuck down.

I still have to learn more about why keys get stuck down. Someone showed me a main sticky thread to read through so I'm there now.

Edited by Aro2220
Link to comment
Share on other sites

I don't want to mess with my drivers. I'm certainly not that tech savvy.

There is a game called Darkfall and it's interface is really....clunky. I'm trying to customize it to my liking. So when I am casting magic I'd like the keys on my keyboard match up with the hotkeys for spells and when I'm using melee I'd like the keys on my keyboard to match up to melee attacks.

Basically, I'm trying to find innovative ways to save keyboard real estate. In the game if I bind fireball to shift+e then I can't bind anything else to shift+e and it's a really nice button to use.

By setting hotkeys in AutoIt I have been able to bind several combat moves to one keystroke, so my shift+e can do fireball or disabling blow or lean right. The problem is there are only so many keys on the keyboard I can use for binds before I get into the shift+ and alt+ and control+ combinations which are not good to use because if I use one of them and hit the key while pressing it, it will get the key stuck down.

I still have to learn more about why keys get stuck down. Someone showed me a main sticky thread to read through so I'm there now.

I am trying to solve this problem indirectly by using the function:

ControlSend("","","","",0)

at the end of each of my send functions.

I think if I do this I can use control/alt/shift combinations in my script again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...