Jump to content
Sign in to follow this  
scott967

Hot Keys in Windows and FSX

Recommended Posts

I'm wondering if some one could give an explanation or link to how hot key functions work with windows and fsx. IIRC in the old DOS days, when a program was launched it could "hook" the keyboard interrupt and look for the keycodes, passing the codes on that didn't match the hot key. So the last program started had first crack at the hot key. But how does it work now. Consider the situation where windows has its hot keys, various apps running have their hot keys, fsx has its key assignments, and can launch exe and dll programs with their own hot keys. Assume that multiple programs, dlls, etc have a setting for F12. What determines which program will receive the hot key, or do they all get it? Is there some way of forcing just one program to react to a hot key? In this context I am treating a "hot key" as as keyboard keycode that a program can receive even when it does not have focus (is this correct)?scott s..

Share this post


Link to post
Share on other sites

It is my understanding that under Windows the active program gets the input/hot key.Run FSX and Excel and have FSX as the active program. Use a common hot key combination between the 2 and see which gets the action. I understand that FSX would.

Share this post


Link to post
Share on other sites

I did some googling and didn't get anywhere. I guess I should do some testing and see what happens. It just seems like every program has some sort of hot key assignment capability.scott s..

Share this post


Link to post
Share on other sites

It depends on how the programs are coded. *usually* the program with the focus gets the keystroke but many applications hook the input and override the app that has focus. Example - the External FPS limiter uses F11/F12 to increase/decrease the FPS in FSX. The ENB bloom mod uses F12 to toggle on/off. If you are running FSX with both active and press F12 - *both* programs will respond and the normal FSX F12 key will not.Unfortunately it is a trial and error situation.Vic


 

RIG#1 - 7700K 5.0g ROG X270F 3600 15-15-15 - EVGA RTX 3090 1000W PSU 1- 850G EVO SSD, 2-256G OCZ SSD, 1TB,HAF942-H100 Water W1064Pro
40" 4K Monitor 3840x2160 - AS16, ASCA, GEP3D, UTX, Toposim, ORBX Regions, TrackIR
RIG#2 - 3770K 4.7g Asus Z77 1600 7-8-7 GTX1080ti DH14 850W 2-1TB WD HDD,1tb VRap, Armor+ W10 Pro 2 - HannsG 28" Monitors
 

Share this post


Link to post
Share on other sites
I'm wondering if some one could give an explanation or link to how hot key functions work with windows and fsx. IIRC in the old DOS days, when a program was launched it could "hook" the keyboard interrupt and look for the keycodes, passing the codes on that didn't match the hot key. So the last program started had first crack at the hot key. But how does it work now. Consider the situation where windows has its hot keys, various apps running have their hot keys, fsx has its key assignments, and can launch exe and dll programs with their own hot keys. Assume that multiple programs, dlls, etc have a setting for F12. What determines which program will receive the hot key, or do they all get it? Is there some way of forcing just one program to react to a hot key? In this context I am treating a "hot key" as as keyboard keycode that a program can receive even when it does not have focus (is this correct)?
There are "hot keys" and simple "key capturing". The term "hot keys" technically refers to key presses which are trapped by Windows for a specific program which has used the Windows hotkey facilities. With that method apps without focus (or even without a visible window) can get them. They can opt to chain them onto the next in line or not, as they wish. I'm afraid I don't know offhand the order though -- i.e. whether the last one gets to the end of the queue or the beginning. I should think Windows tries to be fair and adds new ones to the end of the queue.Capturing keys by interception is a different matter. This is where a program or module hooks into the Windows procedure of a program -- in this case FSX.EXE, say -- and gets to process the KEYDOWN and KEYUP and CHAR messages BEFORE the target program does, passing on those it isn't interested in. This is how FSUIPC keypress programming works, for instance. In this case, yes, if more than one program wants the same keys the one which wins is the last one to insert its hooks. This can mean folks implementing code which periodically checks if they ARE still first and if not insert fresh hooks, removing the originals. Etc. In the latter case the program being hooked needs to be in a position to receive the keypresses in the first place -- i.e. it has the focus.Finally, it is possible to hook the keyboard actions at lower levels, bypassing all of the above, even as far as reading the hardware (or USB input -- keyboards are just another type of HID, like joysticks). There's even a program which will handle multiple keyboards allowing you to assign different things on different keyboards.RegardsPete

Win10: 22H2 19045.2728
CPU: 9900KS at 5.5GHz
Memory: 32Gb at 3800 MHz.
GPU:  RTX 24Gb Titan
2 x 2160p projectors at 25Hz onto 200 FOV curved screen

Share this post


Link to post
Share on other sites

Thanks Pete and Vic --it sort of confirms what I was afraid of -- it can get hairy having a number of programs that use some sort of hot key methodology for control. It came up now because I was running the experimental FS_recorder.dll module and when you are rendering, it has an option to suppress all menus/screen displays within the fsx window, and I realized after starting it there's no way to stop without a hot key (which turned out to be Esc). Normally I don't use hot keys, rather use mouse/menus but that made me think I should really make better use of hot keys for things like this.scott s..

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...