WhatsMyName Posted March 15, 2009 Share Posted March 15, 2009 I know it is not possible to track the Fn key on some keyboards from within AutoIt. I'm hoping, however, that I can react to the action that a Fn + key combo normally activates. I have had some success with this. I will try to explain. I have a tablet PC and it has several buttons on the side that allow you to access different functions. There is a rotate button to turn the display image, a ctl+alt+delete button for rebooting, an ESC key, and ENTER key, scroll up and scroll down buttons, and the dreaded Fn button. When the Fn button is used in comination with the above buttons the following actions happen. Fn+rotate brightens the display, Fn+ctl+alt+delete dims the display, Fn+ESC turns volume up, Fn+ENTER turns volume down, and Fn and the arrows act as PGUP and PGDN. I can catch and react to the PGUP & PGDN and also the volume up and volume down from AutoIt. What I am wondering is if there is a way to intercept and react to the final two button combinations. Is there a function that would show that the display is brightened or dimmed? There may not be, as this may be a hardware function and not a Windows action, like the volume would is. I see the keyboard media buttons can be accessed, so I am hopeful. Any ideas? Link to comment Share on other sites More sharing options...
FireFox Posted March 15, 2009 Share Posted March 15, 2009 @WhatsMyName Its possible with _IsPressed Just let me know if the Msgbox happends when you click on the Fn key and then I will send you pm to know what is the hexadecimal string for the Fn key #include <IsPressed_UDF.au3> ; download the UDF here : http://www.autoitscript.com/forum/index.php?showtopic=86296 ; #Example# =================================================================== ; Name : _IsAnyKeyPressed ; Parameter(s) : Check all keys ; Author(s): FireFox ;=============================================================================== While 1 If _IsAnyKeyPressed() Then MsgBox(64, "_IsAnyKeyPressed", "Key pressed !", 1) EndIf WEnd Cheers, FireFox. Link to comment Share on other sites More sharing options...
WhatsMyName Posted March 15, 2009 Author Share Posted March 15, 2009 The msgbox doesn't display with just the Fn key (as I suspected), it displays on the FN+up, FN+dn, Up, Dn, Enter, ESC. Not on the FN+Rotate or FN+ctl+alt+delete. Doesn't work on the FN+enter or FN+ESC. I can trap these two with the volume up and down functions. Can't seem to catch the brightness buttons. Any other ideas? Link to comment Share on other sites More sharing options...
James Posted March 15, 2009 Share Posted March 15, 2009 Fn is not a recognised key unlike the others. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
WhatsMyName Posted March 15, 2009 Author Share Posted March 15, 2009 Fn is not a recognised key unlike the others.I understand that. I'm not wanting to catch the Fn key itself. I just thought maybe I could catch the function that the key combination produces. I can catch the FN+enter and the FN+esc combinations. These are the volume up and volume down. Evidently there isn't a way to trap the brightness up and brightness down. Must be a hardware function, but there is a little bar that appears on the screen for the brighness and volume level so I suspect there is some software involved somewhere. Not sure exactly how it works. Link to comment Share on other sites More sharing options...
James Posted March 15, 2009 Share Posted March 15, 2009 It will be software based. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now