Start a new topic

click: Activate component's press/release event

Hi.  Just a quick question.


Background:


I have a callback on a slider's release event working just fine. I print "callback" to debug when it happens, and it's 100% reliable.  So I start with a working callback, attached to a slider named "h0" with ID 8.


What I'm trying to do now is also trigger the slider's release event (and hence get a callback) when I press a different button. To do this, in the button's "touch press event" I have the following


click 8,0   


What I would expect to happen, based on the documentation for "click" which I have read carefully, is that when I press the button, the "click" command will trigger the slider's release event (slider ID=8, release event=0) and I should expect a callback. Didn't work, so I tried this...


click h0,0


Documentation says you can use either ID or component name as the first parameter. Unfortunately, this does not seem to work either. I don't see the callback for the slider when I press the button and "click" is executed.


So to my question - a two-parter.  Is "click" expected to trigger the "send component ID" on the object being affected, and is this definitely confirmed to be working?


Many thanks.

A






Send Component ID is within the component

and thus a 0x65 code  0x65 0x00 0x08 0x00 0xFF 0xFF 0xFF

- is evaluated in touch sensor input and not user event code

- requires actual click release of h0 to trigger - and does so well.


Trying to get the 0x65 return via click command is wrong thinking

there is no means to inject fake touch press/release into touch sensor

Only a real touch can trigger the touch sensor.


The click command calls the user event code.

(the Send Component ID is above code, and is indeed separated)


However, using the knowledge of the Nextion Instruction Set

one can code their way to simulate Send Component ID

 - but this code is interpreted by Nextion, not interrupt from sensor.


OK, understood. Thanks for the quick reply.


Uncheck your Send Component ID in h0 release

(assuming page is 0 and h0 is id 8)

put code in release User code section

printh 65 00 08 00 FF FF FF


Now click 8,0 or click h0,0 will simulate


1 person likes this
Login or Signup to post a comment