Jump to content

Archived

This topic is now archived and is closed to further replies.

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

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

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 New...