Jump to content

HotKeySet to F16 button


Recommended Posts

I believe windows only supports up to 12 F keys and on a standard keyboard you would normally have 12. However you may be using some sort of MAC or more expensive keyboard than a standard keyboard and because of that you have more F keys. Autoit is a programming language for windows and therefore does not support any more than 12 F keys. I am not 100% sure on this information but I am pretty sure about it, feel free to correct me if I am wrong anyone ;).

However, there are many different combinations of keys that you could bind to, try using a different one.

Edit: It is likely that there are drivers for your keyboard that you can bind these extra F keys to hotkeys such as CTRL + X and then you can use these hotkeys in your program so although you are pressing a key such as F16 the program would read it as something else and respond to that key.

Edited by Venix
Link to comment
Share on other sites

Try to use

It works fine with common key's (F1-12), but no luck with F13-16. I checked - 0x7C-7F actually sends by keyboard, but call of function from _HotKey_Assign parameters not happens for these keys. I tried both 1.7 and 2b. Edited by aush
Link to comment
Share on other sites

What does your script look like, perhaps there's an error in it somewhere that is the problem?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

BrewManNH

As I said, if I set "Global Const $MY_VK = 0x7A" in my test script, then it works as expected. If I set "Global Const $MY_VK = 0x7F" - it breaks down. So, this F16 failing experience should not be depended on my script.

Edited by aush
Link to comment
Share on other sites

Are you sure your keyboard is actually using those keycode for the F13-F16? What did you use to verify that the keycodes are being sent as 0x7C - 0x7F? Those are the standard codes sent by those keys, but it's been a very very long time since I've seen a keyboard with 16 F keys, not since the old IBM PC days. So, if it's a newer keyboard than that perhaps they've recoded the keys to something else..

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

BrewManNH,

You can check it pretty easy.

1. Take the SharpKeys utility http://www.randyrants.com/2011/12/sharpkeys_35.html (It's opensource. Actually it just lets you not to touch a registry by your own hands) and set any key to 0x007F.

2. Reboot and then start the sharpkeys again. It has a "Type Key" button, which shows the button you press and it's code. Then you can see that F11 returns 0x007A and your new binded key returns 0x007F.

3. Then just try this simple test

#include <HotKey_20b.au3>
Global Const $TEST_VK_F11 = 0x7A
Global Const $TEST_VK_F16 = 0x7F
_HotKey_Assign($TEST_VK_F11, "TestFunc_F11")
_HotKey_Assign($TEST_VK_F16, "TestFunc_F16")
While 1
    Sleep(100)
WEnd
Func TestFunc_F11()
MsgBox(1, "title", "F11")
EndFunc
Func TestFunc_F16()
MsgBox(1, "title", "F16")
EndFunc
Edited by aush
Link to comment
Share on other sites

I would suggest a infinite while loop with a inner´loop using _IsPressed function with value from x'00' to x'FF'.

I cannot elaborate further due to the forums rules concerning 'key-loggers'.

My working code would be erased instantly.

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Do the F13-F16 have any current functionality on the computer right now, do they actually do anything when you press them? Who makes the keyboard you're using?

I've done a bit of research on keyboards with up to 16 F keys, and almost everything I've found is that Mac keyboards are the only ones that have those keys. If it's a Mac keyboard, their F16 key maps to Windows Print Screen key, with a different keycode.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Who makes the keyboard you're using?

It's custom device, which uses these codes. I just had a thought, you know, there is the key-code, and it actually sends and there is the function, which binds key-codes to some action, so why is that a problem about these key-codes? I'm a bit of programmer myself and when I have the function working correctly with "1", "2", "5", "42" inputs and then not working with "4" or "17", I start thinking that maybe it's not a problem about the numbers, but about my function. Edited by aush
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...