summaryrefslogtreecommitdiff
path: root/nichrome
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-02-12 09:08:58 -0800
committerKeith Packard <keithp@keithp.com>2009-02-12 09:08:58 -0800
commit22741429bdc32b6c4d2f5582d2b15d8b1b905a93 (patch)
tree4c64f30f93b29a05aedb2d93021ee6785cf1453b /nichrome
parent3f5172309065540852e28551aa7ad8b46e0a03bd (diff)
Ignore buttons > 3
Diffstat (limited to 'nichrome')
-rw-r--r--nichrome/nichrome-button.5c4
-rw-r--r--nichrome/nichrome-toggle.5c4
2 files changed, 8 insertions, 0 deletions
diff --git a/nichrome/nichrome-button.5c b/nichrome/nichrome-button.5c
index 94b83aa..9112027 100644
--- a/nichrome/nichrome-button.5c
+++ b/nichrome/nichrome-button.5c
@@ -150,10 +150,14 @@ extend namespace Nichrome {
protected void button (&button_t widget, &button_event_t event) {
enum switch (event.type) {
case press:
+ if (event.button > 3)
+ break;
widget.pressed = true;
Widget::redraw (&widget);
break;
case release:
+ if (event.button > 3)
+ break;
Widget::redraw (&widget);
widget.pressed = false;
if (widget.inside)
diff --git a/nichrome/nichrome-toggle.5c b/nichrome/nichrome-toggle.5c
index 8fab60e..1e9df76 100644
--- a/nichrome/nichrome-toggle.5c
+++ b/nichrome/nichrome-toggle.5c
@@ -56,9 +56,13 @@ extend namespace Nichrome {
public void button (&toggle_t widget, &button_event_t event) {
enum switch (event.type) {
case press:
+ if (event.button > 3)
+ break;
set (&widget, !widget.pressed);
break;
case release:
+ if (event.button > 3)
+ break;
default:
break;
}