Jump to content

hyperspherical

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by hyperspherical

  1. Hi inmarket, I've tried your idea, but the issue with it is that I'd like to have a Button Release event. I need to know both when it's initially pressed and when it's finally release based on events rather than polling. The checkbox does give me an event when I press but doesn't seem to issue any events when it's released. The functional requirement is like this: Person presses a screen button and that triggers an output function. Whilst the button is still pressed the output continues. The person releases the button and the output stops. If this is done with events then the button release event can trigger the appropriate output to stop. Otherwise I have to use a timer to poll that button, which is more tangled than just acting on the event. I had one hacky idea, which was to swap the checkbox type to a button type after it was pressed ? That way I'd could get a GEVENT_GWIN_CHECKBOX for the press and a GEVENT_GWIN_BUTTON for the release.
  2. I'm looking for the correct way to add an event similar to GEVENT_GWIN_BUTTON for standard gwinButtonCreate() type buttons triggered from a touchscreen or possibly any input. The purpose is to create a type of latched state that is released by the normal GEVENT_GWIN_BUTTON. This way I can immediately respond to a button press, set an output to a state and hold that state until the button which in this case is a touchscreen is released and thus debounced by the uGFX button state management. I've attempted to create an event by using the customDraw (callout) parameter to capture the press state and to send my own type of GEVENT_GWIN_BUTTON back to the listeners so they can process the event and manage the latching output. I started looking at the hacky way of calling _gwinSendEvent but that breaks the API and if I was going to do that I may as well hack my own event into the gwin_button code. Although if I did add that code then I would also add the latch internally so that repeated events didn't occur. Basically adding GEVENT_GWIN_BUTTON_PRESS event. Any ideas and code snippets ?
×
×
  • Create New...