Jump to content
Sign in to follow this  
Vauban

Keyboard events received by sim when not the focus

Recommended Posts

Hello,

I imagine this problem has been reported but I'm finding the topic difficult to locate. I'd appreciate a pointer.

I have many keyboard keys assigned to cockpit actions. When I shift away from the sim to type some text in a different app, those key strokes are still recognised by the sim, even when the sim doesn't have focus. It plays havoc with the cockpit setup .  

Surely I don't have to precede every script with (FOCUS:flightsimulator).   😦 On page 100 of the manual, there's a note: On Windows systems, only the app that has the focus will receive keyboard events.

Cheers and thanks

 


Geoffrey Kent

Share this post


Link to post
Share on other sites
Quote

 

When you assign the key events in AAO, then they will always be recognized and processed, regardless of what app has the focus. Just like Joystick events etc.

AAO is not a normal Windows app in that regard, it has been hooked into the keyboard driver and doesn't care about what Windows is doing.

If you don't want this, the only way that I can see is changing the control layer in AAO. Know what I mean? You create a key combo that switches to a control layer that has nothing on it - that way AAO won't trigger any actions in the sim. When you are done typing, switch the layer back to where your assignments are.

 

 

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Thanks for the tip - it's what I was looking for. But I've run into a problem at the first step.

I have all my buttons assigned in layer 0, meaning the actions go to the keyboard driver, regardless of which layer is active. I exported them to a template, intending to import them back into layer 1 and then delete them all from layer 0. This was my workaround for copying from layer 0 to layer 1.

However, after exporting the actions to a template, I find all my button assignments are now not only in the layer 0, but also duplicated in layers 1, 2 and 3. This happened without me importing the template back into a layer.

By trhe way, I also found that layer 0 is now called 'Default', which I can understand, but I don't know what happened to change it.

Is this the right approach, and can I safely remove all my assignments now from layers 0, 2 and 3? When that's clear, I'll turn my attention to switching between layers 1 and 0 (page 15).

Thanks for your help so far.


Geoffrey Kent

Share this post


Link to post
Share on other sites
53 minutes ago, Vauban said:

 I find all my button assignments are now not only in the layer 0, but also duplicated in layers 1, 2 and 3.

What does "duplicated" mean? Can you post a screenshot?

The control layers are not some kind of "group" that "contain" your buttons. Switching to another layer does not "load" new buttons, the list always remains the same. The buttons exist regardless of the layers, they are not "in" anything. The Layer is just a numerical attribute of the button assignment, nothing more. When you want the button "in" a differnt layer, you edit the layer in the Change Button dialog. There is no reason whatsoever to export and re-import the buttons, that is just not how it works. (did you press "merge" btw? That would indeed multiply your button assignments - but that has nothing to do with the layers - as explained, you cannt import/apply a template into a  specific layer - that is not possible.)

You do have the latest version of AAO, right?

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

I have V 3.60.

Many thanks for taking the time to explain all that - I completely misunderstood the concept. I have now edited all the button assignments to put them "in" (😉) control layer 1.

Now, when I select Layer 1 (between '+'  and '-') I see all my assigments, tagged in yellow as being in (belonging to) Layer 1. And my problem is solved - my button/key assignments go only to the sim. I just have to remember to switch to Layer 1 after I fire up the sim, and switch to a different layer when I want to type. 

To my surprise, when I select Layer 2 (or 3, or Default) and expect to see a blank list of assigments, I see the same list of my Layer 1 assignments. So I still haven't quite grasped the concept, but  job done.

Thanks again. 

 

Edited by Vauban

Geoffrey Kent

Share this post


Link to post
Share on other sites
1 hour ago, Vauban said:

To my surprise, when I select Layer 2 (or 3, or Default) and expect to see a blank list of assigments, I see the same list of my Layer 1 assignments. So I still haven't quite grasped the concept, but  job done.

You will always see all assignments...as I tried to explain, the layer is not a "thing", not a "group", no nothing. It is just a number, an attribute of the button assignments.

I will try another analogy: the control layer is the equivalent of a hat (yes, I mean the thing that you wear on your head). You can make a button wear a hat of a certain color on the add/change dialog. If you then select a certain color in AAO, let's say control layer "yellow", then only those buttons wearing a yellow hat can be used. When a button is not wearing any hat (layer 0), and when there are no clones of it, then it is active no matter what color AAO is switched to.
Clones in this case mean button assignments to the same keyboard combo, but wearing different hats. That way you can have one and the same keyboard or joystick button combo do different things on different layers.

Be mindful that control layers can be switched using events = you can create a button assignment for this "switching action" too, you don't have to use the mouse.

I'd suggest taking a look at the AAO manual, chapter 3.5 "Control layers". Maybe things will become clearer then.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

That's great, thank you. I love the hat analogy. I'll take a look at creating a button assignment for switching between layers.


Geoffrey Kent

Share this post


Link to post
Share on other sites

Hello.

I had the same issue.  I followed your guide and put all the keyboard combos to the yellow layer and kept all joystick ones to the default.  I have also a "aao_button_layer_up" combo so as to switch between the default and the yellow

I have made a small guage that i want it to be visible when the yellow is active.  Unfortunately the value   (L:AaoLayerYellow) 1 ==  does not work.

Is this the correct value?  What am i doing wrong?

Thanks in advance

Edited by A320SimPilot

Share this post


Link to post
Share on other sites
44 minutes ago, A320SimPilot said:

Hello.

I had the same issue.  I followed your guide and put all the keyboard combos to the yellow layer and kept all joystick ones to the default.  I have also a "aao_button_layer_up" combo so as to switch between the default and the yellow

I have made a small guage that i want it to be visible when the yellow is active.  Unfortunately the value   (L:AaoLayerYellow) 1 ==  does not work.

Is this the correct value?  What am i doing wrong?

Thanks in advance

Check the manual

Quote

The current layer can be queried from internal LVars: (L:AaoButtonLayer) and (L:AaoAxisLayer).

The LVars will have the value that corresponds to the current layer, for buttons and axis separately, counting up from 0 as the default/no color layer

Edited by Lorby_SI

LORBY-SI

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