One encoder with multiple buttons

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Post Reply
Message
Author
arlofou
Posts: 2
Joined: Sat Jan 11, 2025 7:54 pm

One encoder with multiple buttons

#1 Post by arlofou »

I am wondering if it is possible to use one encoder and several buttons to have the buttons select the proper knob (on a G1000 for instance) and then have the encoder control that parameter. Then push another button to have it control something else.
Anyone know if that is possible (and easy)?

Thanks

SimPassion
Posts: 5772
Joined: Thu Jul 27, 2017 12:22 am

Re: One encoder with multiple buttons

#2 Post by SimPassion »

arlofou wrote: Mon Jan 20, 2025 7:04 pm I am wondering if it is possible to use one encoder and several buttons to have the buttons select the proper knob (on a G1000 for instance) and then have the encoder control that parameter. Then push another button to have it control something else.
Anyone know if that is possible (and easy)?

Thanks
Yes done with XPDR personal instrument, also implemented a full simulation platform shutdown from it
You'll have to managed dials input visual designation on your own and backup your current state and location. This could be made in a loop including a default position without any visual designation, which would mean you're not on a dial or button selection, so no input at this time.
I've included a long press in the script, which says we enter in the dials/buttons/switches selection and indeed have to return in default state at the end, to go out selection and input.

User avatar
Ralph
Posts: 8383
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: One encoder with multiple buttons

#3 Post by Ralph »

Has been asked a couple of times on the forums, so I think with some searching you will find an example.

arlofou
Posts: 2
Joined: Sat Jan 11, 2025 7:54 pm

Re: One encoder with multiple buttons

#4 Post by arlofou »

Thanks guys. I did search for this, but propbably didn't use the right word combination. I'll keep trying.

Ron

User avatar
Ralph
Posts: 8383
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: One encoder with multiple buttons

#5 Post by Ralph »

I couldn't find it as well. Something like this:

Code: Select all

state = "HEADING"

hw_dial_add("Generic dial"', function(dir)

  if state == "HEADING" then
    if dir == 1 then
      -- Something something
    else
      -- Something something else
    end
  end

  if state == "COURSE" then
    if dir == 1 then
      -- Something something
    else
      -- Something something else
    end
  end

end)

hw_button_add("Activate heading input", function()
  state = "HEADING"
end)

hw_button_add("Activate course input", function()
  state = "COURSE"
end)

Post Reply