-- C
After short code investigation: now we don't receive finger tap event
from system -- we receive just usual 'mouse pressed event' -- with the
same parameters as for stylus tap. :( I have no ideas. :((
May be, it's problem of our devices? Does finger tap work in FBReader
on other N800s?
-- Nikolay Pultsin
--
Misha
The reporting of finger taps changed once again. Now finger taps are
reported using pressure sensitivity. I don't know exactly how it is
done with Gtk+, but I think the docs at maemo.org ought to explain it,
although I cannot find it right now. I seem to remember
gtk_widget_set_extension_events[1] being mentioned.
[1] http://maemo.org/platform/docs/api/gdk/gdk-Input-Devices.html
I planned to figure this out and send a patch when I found a free
weekend, but (1) I didn't find a free weekend, and (2) bzr started
choking on my fbreader trees, so I'm stuck waiting until the bzr
developers get the bug fixed. Also, see (1).
Marius Gedminas
--
If you want to trick a pointy-haired boss into letting you write software in
Lisp, you could try telling him it's XML.
-- http://www.paulgraham.com/icad.html
thank you for your comment. I've fixed this problem (see code below).
I cannot explain magic constant 0.4 -- it is experimental value.
-- Nikolay Pultsin
static bool isStylusEvent(GtkWidget *widget, GdkEventButton *event) {
if (event->button == 8) {
return false;
}
if (event->state & GDK_MOD4_MASK) {
return false;
}
if (gtk_widget_get_extension_events(widget) ==
GDK_EXTENSION_EVENTS_NONE) {
return true;
}
double pressure;
gdk_event_get_axis((GdkEvent*)event, GDK_AXIS_PRESSURE, &pressure);
return pressure < 0.4;
}
That's nice.
> static bool isStylusEvent(GtkWidget *widget, GdkEventButton *event) {
...
> if (gtk_widget_get_extension_events(widget) ==
> GDK_EXTENSION_EVENTS_NONE) {
> return true;
> }
> double pressure;
> gdk_event_get_axis((GdkEvent*)event, GDK_AXIS_PRESSURE, &pressure);
> return pressure < 0.4;}
I learned today on the maemo-de...@maemo.org list that there
exists a Hildon convenience function for this:
hildon_button_event_is_finger(event) in <hildon-widgets/hildon-
finger.h>
Source: http://maemo.org/pipermail/maemo-developers/2007-March/009321.html
Marius,
AFAIK, this file (hildon-finger.h) is not included in maemo 2.* SDK.
It is presented in maemo 3.0, but FBReader package builded with maemo
3.0 SDK cannot be installed on Nokia 770. So, we cannot use this
function. :(
-- Nkolay Pultsin