Thread: Hotkeys with [Fn]

  1. #1
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879

    Hotkeys with [Fn]

    Hey everyone, what I'd like very much to do is create a program that will recognize hotkeys that involve the Fn key of my laptop. However, RegisterHotKey() doesn't seem to have support for the Fn key. I then looked at the WM_SETHOTKEY message, which allows the HOTKEYF_EXT flag ('extended key'). I seem to recall somewhere else on MSDN saying that 'extended key' can refer to the Fn key, but I'm not sure; does anyone know more about this?

    Also, MSDN says "When the user presses the hot key, the system activates the window." Does this just mean a WM_ACTIVATE message is sent to it each time the hotkey is pressed? If so, can the window always remain hidden and just spawn a second window to interact with the user, or will the window itself spontaneously appear?

    Thanks in advance for any info (and ideas for better ways of achieving this are also very much appreciated).
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #2
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Hm. Well, WM_SETHOTKEY doesn't do it, but it seems that a unique virtual-key code is sent for different Fn-F# combinations, and since I have a seemingly unused Fn-F12 combination, that shall suit my purposes just fine with the regular SetHotKey(). Ran into more problems with some other stuff (jeez, power settings on a laptop aren't simple to modify programmatically!), but I'm sure it'll all work out in the end with enough experimentation.

    Thanks goes out to the 10 people who've looked at this thread

    [edit]Never mind about power settings not being easy to modify. I didn't realize there's a handy dandy API that makes what I want to do pretty much as simple as 2 function calls...[/edit]
    Last edited by Hunter2; 04-05-2005 at 11:19 AM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Hotkeys!
    By guitarist809 in forum Windows Programming
    Replies: 3
    Last Post: 07-21-2008, 11:01 PM
  2. Enumerating timers and hotkeys
    By maxorator in forum Windows Programming
    Replies: 3
    Last Post: 01-01-2007, 11:47 AM
  3. remapping hotkeys and Winamp
    By confuted in forum Tech Board
    Replies: 0
    Last Post: 08-30-2003, 03:54 PM
  4. BCB and Hotkeys
    By Zeedo in forum C++ Programming
    Replies: 3
    Last Post: 12-14-2002, 03:44 PM
  5. make your own hotkeys?
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 04-13-2002, 07:22 PM