Sujet : Re: Androwish Label Font
De : undroidwish (at) *nospam* googlemail.com (undroidwish)
Groupes : comp.lang.tclDate : 28. May 2025, 22:59:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <101810v$3f29t$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0
On 5/28/25 19:44, nemethi wrote:
Many thanks, Christian! In the meantime I have found out why my proposed solution fails and how to make it work, but your proposal to use Button-2 bindings rather than <<Finger...>> virtual events appears to be the better solution (I didn't know that the swipe gestures emulate <Button-2>, <B2-Motion> and <ButtonRelease-2> events).
Just for completeness, here is my corrected solution using <<Finger...>> events:
foreach class {ScrollableframeMf ScrollableframeCf} isCf {0 1} {
bind $class <<FingerDown>> { set motionCount 0 }
bind $class <<FingerMotion>> [format {
if {[incr motionCount] == 1} {
scrollutil::sf::onButton1 %%W %%x %%y %d
} else {
scrollutil::sf::onB1Motion %%W %%x %%y %d
}
} $isCf $isCf]
bind $class <<FingerUp>> [list scrollutil::sf::onButtonRelease1 %W $isCf]
}
If I understand the manual correctly, <<FingerDown>> events have no %x and %y fields, hence the scrollutil::sf::onButton1 proc is now invoked on the first <<FingerMotion>> rather than on the <<FingerDown>> event. This makes the trick. But, as said, your proposal is in IMHO the better one.
Csaba, please read the fine print of the sdltk manpage. The problem is,
that most capacitive touchscreens detect more than one finger, many up
to 10.
And the <<FingerMotion>> description states (note the last sentence):
"A touch movement (sliding) event. The fields %x and %y are substituted
with the finger position scaled to {0...9999} of the device screen or
viewport, %X and %Y with the motion difference scaled to
{-9999...+9999}, %t with the pressure scaled to {0...9999}, and %s with
the finger identifier {1...10}. These substitutions are performed for
all finger related touch events."
So taken the 4 to 6 states of freedom of all finger events I guess the
logic in the binding could become quite complicated. That was the main
motivation to have the emulation of Button-2 in a lower layer, BTW.
Now that we have thought out some possible solutions, my hope is that
Michael will try it, giving us feedback if things works as he expects.
All the best,
Christian