How to make ofxGui respond to keystrokes?

Hi!
I´ve been hooking ofxGui to a video player app and already got its parameters to influence my program variables.
How can I make keystrokes (and/or variables) influence the values of, say, a ofxGui slider?
I tried, without success, to use the following command on the keyReleased script, but couldn´t pass a float on the void* data slot.

  
handleGui(int parameterId, int task, void* data, int length)  

Thank you.

PS - I just finished my 1st month of C++/OF studies and already made some great achievements, as far as meeting my expectations of playing and controlling video at very fast speeds :wink:
Thanks to all developers! OF rocks the house!

i don’t know anything about ofxGui, but to pass a float as a void* parameter, you go something like this:

  
  
float thing = 5.3f;  
handleGui( whatever, whatever, (void*)&float, whatever );  
  

hth
d

Hi, Damian. Thank you.
I could pass the float as you showed, but it didn´t make ofxGui respond yet. I´ll still be trying.

sorry - that should’ve been

  
handleGui( whatever, whatever, (void*)&thing, whatever );   

ie (void*)&thing, not (void*)&float

Thanks, Damian. I already had understood the typo and tryied without success, the (void*)&thing.
The problem is that I didn´t fully grab yet the ways of the ofxGui.
I posted a link to this thread on a more ofxGui specific thread. Let´s see what will come up.

[quote author=“AlexandreRangel”]Thanks, Damian. I already had understood the typo and tryied without success, the (void*)&thing.
The problem is that I didn´t fully grab yet the ways of the ofxGui.
I posted a link to this thread on a more ofxGui specific thread. Let´s see what will come up.[/quote]

Hi Alexandre,

  
handleGui(int parameterId, int task, void* data, int length)  

The handleGui method is the callback method where ofxGui tells the listener (the main application in most cases) that a control with an id of “parameterId” has new data of type task (in your case kofxGui_Set_Float ). If you want to update a control you have to use this call.

  
gui->update(parameterId, kofxGui_Set_Float, &data, sizeof(float));  

This will tell your ofxGui instance (gui) to update a control with id parameterId with float data (kofxGui_Set_Float) and the size of a float where data is a pointer to your float value.

Hope that this info will help you with your project. Keep in mind that ofxGui is just a quick hack demo library that i put together to get my synth stuff going. There are a lot of other GUI extentions available for openFrameworks which might fit better into your working code or have better documentation :slight_smile:

Cheers,

stiwi

Worked flawlessly, stiwi! Thank you!
As far as choosing your GUI to implement on my project, it was the only GUI I could configure and build still.
Setting up is not that difficult, now that I understand the process.
It causes no performance penalties, and works very fast itself.
So I think I do some more tests with it and see if I can still be using it.

Cool. I am happy to hear that it works out fine for you. Let me know if you need more info. It would be cool if you could post a image / link of your project. It’s interesting to see how people are using ofxGui.

Hi, stiwi. Here’s a video of your interface on working on my project. Thanks!

http://forum.openframeworks.cc/t/quase-cinema-vj-software/1472/0

Very cool. Great work. It looks fantastic. Thanks a lot for posting the link.

What is the most excellent gaming AND multimedia laptop from Asus? You don’t have to recommend the G-series because I already know what it is. So, is there any other gaming and multimedia gaming laptop out there other than the G-series laptops?