Air Manager / Knobster / Custom Instrument

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Message
Author
zenom
Posts: 2
Joined: Mon Oct 11, 2021 4:26 pm

Air Manager / Knobster / Custom Instrument

#1 Post by zenom »

I really liked KnobXP but wanted something I could push the buttons on in Air Manager. I created a knob that has the same sort of commands. Minor CW, Minor CCW, Major CW, Major CCW and then I also have a button press command.

All the knobs work, but the button press on the minor button does not work from the knobster. It works if I disable the knobster and use the mouse, but it does not work when highlighted and I click minor knob with the callback set.

Code: Select all

dial_minor = dial_add("alt_knob.png", 30, 42, 90, 90, 1, minor_callback, knob_pressed_callback)

function knob_pressed_callback()
    xpl_command(user_prop_get(minor_pressed_cmd))
end
What am I missing for the knobster to do the knob_pressed_callback?

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

Re: Air Manager / Knobster / Custom Instrument

#2 Post by Ralph »

That's not how the dial works for button presses. What you're using is a dial pressed and released callback, that's not meant to act as a button. You have to add a button on top of the dial.

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Air Manager / Knobster / Custom Instrument

#3 Post by Keith Baxter »

Ralph wrote: Mon Oct 11, 2021 5:27 pm That's not how the dial works for button presses. What you're using is a dial pressed and released callback, that's not meant to act as a button. You have to add a button on top of the dial.
@Ralph

Suggestion...

The API does little to elaborate on this function. Something to look at and enhance for users.

I am referring to the "Example" section of the API...

What exactly does....

dial_id = dial_add(image, x, y, width, height, acceleration, direction_callback, pressed_callback, released_callback)

Do ???

http://siminnovations.com/wiki/index.php?title=Dial_add

Keith

EDIT: A example relating to Knobster characteristics, i think would be a useful indication in all features.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

zenom
Posts: 2
Joined: Mon Oct 11, 2021 4:26 pm

Re: Air Manager / Knobster / Custom Instrument

#4 Post by zenom »

Is this just for knobster? Because if I do touch, it works fine, but with the knobster it doesn't. Which is confusing.

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

Re: Air Manager / Knobster / Custom Instrument

#5 Post by Ralph »

No like I said, this is not for the Knobster. This is only for mouse and touch. It is the callback for press and release of the dial. The Knobster has no way of knowing if your fingers are on the dial. Sounds pretty obvious to me :) But I'll add a description to the wiki.

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

Re: Air Manager / Knobster / Custom Instrument

#6 Post by Sling »

A dial is a rotary control so by definition any callbacks used with it are related to its use and nothing to do with buttons. I agree with Ralph I think this should be obvious. As stated several times on this forum previously the knobster functionality is implicit to the way the base instrument is coded. Meaning if you co-locate a button with 2 rotaries (dial etc) then you get the 3 independent functions that a knobster provides. If you omit one of the 3 then that functionality will be missing from the knobster also. The knobster does not add instrument functionality, it just mimics the soft controls into hardware.

User avatar
jph
Posts: 2856
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Air Manager / Knobster / Custom Instrument

#7 Post by jph »

Agreed, an overreaching desire to 'make things more user friendly (from one persons perspective!) ' most often leads to more confusion.
Joe. CISSP, MSc.

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Air Manager / Knobster / Custom Instrument

#8 Post by Keith Baxter »

Hi,

For me, and obviously the OP and possibly many more users, there is a lack of explanation on how the {"pressed_callback" and "released_callback"} argument/callback works. Sorry @Sling I disagree with it being obvious, for me at least.

Basically what I am saying is that the API/WIKI is a little light with how these arguments/callbacks work. And. If they work with Knobster.

I wonder why the pressed arguments were implemented in the first place? Helping me to understand these functions would be awesome.

Yes guys, stacking dials and buttons in Z order is probably the better option and best understood. I use that method and it works perfectly.


Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

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

Re: Air Manager / Knobster / Custom Instrument

#9 Post by Sling »

Keith,

Obvious in the sense that you need some understanding of what a callback is, what a dial is and how the API functions apply these. If you dumb it down so much you will end up with stuff like you see in product instructions to protect against stupidity. Think about in the context of dial what a pressed callback would do. The wiki currently says ‘This function will be called when the dial is being pressed.’ A Dial is a rotary device and has no button so the pressed in this context I interpret as the press of the mouse or your finger in the case of touch. Release by its name implies it gets called when you let go of the mouse click or lift your finger. Because they are useful in some instances but not absolutely needed in all cases for a dial they are optional arguments.

As I explained before to make the soft controls for everything on a knobster to control, one needs to add 2 dials and a button all co-located. In the OP’s case he omitted the button which is why the knobster only saw the 2 dials. When not using knobster it appeared as though a soft button was there because the pressed or release callback was used. Remembering that when the dial is first clicked/touched the pressed callback gets called. Knobster by its nature of being physical hardware cannot action the pressed or release callback for the rotary dial. It makes absolute sense and is just a case of understanding. I suppose more could be written on the wiki but as I implied I think it’s implicit with the names used and how the other API functions also use these names.

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Air Manager / Knobster / Custom Instrument

#10 Post by Keith Baxter »

Sling wrote: Tue Oct 12, 2021 4:01 pm Keith,

Obvious in the sense that you need some understanding of what a callback is, what a dial is and how the API functions apply these. If you dumb it down so much you will end up with stuff like you see in product instructions to protect against stupidity. Think about in the context of dial what a pressed callback would do. The wiki currently says ‘This function will be called when the dial is being pressed.’ A Dial is a rotary device and has no button so the pressed in this context I interpret as the press of the mouse or your finger in the case of touch. Release by its name implies it gets called when you let go of the mouse click or lift your finger. Because they are useful in some instances but not absolutely needed in all cases for a dial they are optional arguments.

As I explained before to make the soft controls for everything on a knobster to control, one needs to add 2 dials and a button all co-located. In the OP’s case he omitted the button which is why the knobster only saw the 2 dials. When not using knobster it appeared as though a soft button was there because the pressed or release callback was used. Remembering that when the dial is first clicked/touched the pressed callback gets called. Knobster by its nature of being physical hardware cannot action the pressed or release callback for the rotary dial. It makes absolute sense and is just a case of understanding. I suppose more could be written on the wiki but as I implied I think it’s implicit with the names used and how the other API functions also use these names.
Yes Tony

All this is crystal clear in the API? :roll: Sorry for my sarcasm but I have a different view.

My comments were/are not intended to swing handbags, but assist others that are not so learned.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply