Push button not working?

Support for the SimWareKits Knobster in combination with Air Manager and Air Player

Moderators: russ, Ralph

Post Reply
Message
Author
Crash'n'Burn
Posts: 256
Joined: Wed May 30, 2018 8:47 pm

Push button not working?

#1 Post by Crash'n'Burn »

I just got the Knobster and I don't think the push button is working. I've tried mapping it as a push button, then as a push-and-release button, neither works. I've mapped the command to a button and the command works, only with the button and not with the Knobster's push button. Air Plugin is 3.2, Air Manager is 3.7. Is there any other way to test the Knobster? I've tried disconnecting then reconnecting the device, I've restarted both XP and Air Manager multiple times, still nothing.

Thanks!

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

Re: Push button not working?

#2 Post by Ralph »

The Knobster does not work with buttons, only if they're on a dial. Only switches and dials. A button wouldn't make sense for the Knobster, because you have to select the button anyway.

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Push button not working?

#3 Post by Sling »

As Ralph says it’s not designed to work with individual buttons. To test it you need a rotary control that has a button co-located such as a heading bug knob with push to sync or one of the GPS knobs with a button on the end of the shaft.

Tony

Crash'n'Burn
Posts: 256
Joined: Wed May 30, 2018 8:47 pm

Re: Push button not working?

#4 Post by Crash'n'Burn »

Sorry, what I mean is that I am mapping the push button on the Knobster to a command and it does not work. I tried it on the Garmin 530 on the Cessna 172 and it's working so at least it's not a defective unit which was my initial worry.

When I said push and push-and-release, I was referring to these formats:
dial_id = dial_add(image, x, y, width, height, direction_callback, pressed_callback)
dial_id = dial_add(image, x, y, width, height, direction_callback, pressed_callback, released_callback)

I tried that as well because I noticed on some aircraft, a command would not be recognized if it was just a quick press and needed a slight pause between the push and the release of the button.

Here is my actual code:

Code: Select all

function spd_sync_press()
	xpl_command("sim/autopilot/knots_mach_toggle")
end

dial_spd = dial_add("red.png", 490, 73, 101, 101, 5, spd_dir, spd_sync_press)
In the sim, when I press the spd dial, it changes readout from knots to mach. Using the push button on the Knobster to do the same doesn't work. There's a similar function for the heading dial where pressing the button would sync the heading bug to the current heading, that doesn't work either.

Code: Select all

function hdg_sync_press()
	xpl_command("sim/autopilot/heading_sync")
end

dial_hdg = dial_add("red.png", 187, 73, 101, 101, 5, hdg_dir, hdg_sync_press)

I mapped the same command to a button and it works no issues.

Code: Select all

function hdg_press()
	xpl_command("sim/autopilot/heading_sync")
end

btn_hdg = button_add("red.png", "red.png", 187, 0, 101, 72, hdg_press)

User avatar
Sling
Posts: 5239
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Push button not working?

#5 Post by Sling »

You are not understanding how the knobster works.

You cannot write code specifically for the knobster. The knobster will automatically provide a hardware control for corresponding soft controls. The dial pressed and released callbacks are related to the operation of the dial and does not refer to a button. These will get called as the dial is rotated. If you want a button on the end of a dial shaft think about how you would need to code that as a soft control. Check the GNS dials that have end buttons if you can’t picture what’s needed. Essentially it means you need to locate a button on top of a dial. The co-located button callback is where the command for the knobster button operation needs to go.

Tony

Crash'n'Burn
Posts: 256
Joined: Wed May 30, 2018 8:47 pm

Re: Push button not working?

#6 Post by Crash'n'Burn »

Thanks! I took a look at the GNS dials and it made more sense.

Post Reply