トップ «前の日記(2010-01-17) 最新 次の日記(2010-02-06)» 編集

AOISAKURA 日記

2003|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|04|05|06|07|08|09|12|
2013|02|03|05|06|08|09|10|11|
2015|11|
2016|12|
2017|03|08|
2018|01|03|06|
2019|05|07|09|10|
2020|01|02|03|
2021|03|07|
2022|06|
2023|11|

pixiv / twitter

bluesky / misskey / pawoo

※発信する情報は、個人の見解・意見であり、所属する会社の見解・意見ではありません。


2010-01-21 ぼちぼち [長年日記]

_ [X][wacom] xf86-input-wacom でポインタが飛ぶのを暫定回避

Thinkpad x61 tablet で、Xorg 1.7 以降、XInput の使い方が変わった関係で、新しい方( xf86-input-wacom )を使う事になった。で、使えてはいるんですが、touch を有効にした状態で stylus を使うと一定以上筆圧をかけたときに、ポインタが飛ぶという問題が発生した。

DebugLevel を 12 に設定して、ログを追いかけると、ポインタが飛ぶタイミングで、touch のイベントが起きていました。どうも、ちゃんとデータの parse ができていない模様。なんですが、実装が正しいのか間違っているのかがわからず( この個所は以前からほとんど変わりが無い )、問題の切り分けができていない。

というわけで、アドホックに、stylus を使っている時は、touch のイベントを無視するように src/wcmISDV4.c を修正して回避した( パッチ対象は 2010.1.20 21:00:00 現在の trunk )。

--- src/wcmISDV4.c.orig 2010-01-20 21:59:41.038532466 +0900
+++ src/wcmISDV4.c      2010-01-20 22:00:25.529773107 +0900
@@ -401,6 +401,8 @@
        WacomDeviceState* ds;
        int n, cur_type, channel = 0;
+    static int isInStylus = 0;
+
        DBG(10, common, "\n");
        /* determine the type of message (touch or stylus) */
@@ -443,6 +445,8 @@
        if (common->wcmPktLength != WACOM_PKGLEN_TPCPEN) /* a touch */
        {
+        if (isInStylus == 1) return common->wcmPktLength;
+
                ds->x = (((int)data[1]) << 7) | ((int)data[2]);
                ds->y = (((int)data[3]) << 7) | ((int)data[4]);
                if (common->wcmPktLength == WACOM_PKGLEN_TOUCH9A)
@@ -500,6 +504,16 @@
                /* pressure */
                ds->pressure = (((data[6] & 0x07) << 7) | data[5] );
+        if (ds->pressure > 0) {
+            // stylus set ground
+            if (isInStylus == 0) {
+                isInStylus = 1;
+            }
+        } else {
+            // in/out proximity
+        isInStylus = 0;
+        }
+
                /* buttons */
                ds->buttons = (data[0] & 0x07);