Jump to content
Sign in to follow this  

Fn key help

Recommended Posts


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?

Share this post

Link to post
Share on other sites


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)

Cheers, FireFox.


OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control


Share this post

Link to post
Share on other sites

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?

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.