Как определить кнопку Pixelbook Pen? - PullRequest
0 голосов
/ 29 сентября 2018

Я следую документу здесь , чтобы поймать кнопку, нажатую на ручке Pixelbook во время рисования, но событие TOOL_TYPE_ERASER никогда не генерируется.Когда я попытался распечатать журнал, я не вижу различий между удержанием и отпусканием кнопки:

onTouchEvent:MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=2010.4766, y[0]=778.10156, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1395185, downTime=1395185, deviceId=1, source=0x1002 }
2018-09-29 16:15:35.527 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2009.2734, y[0]=777.6406, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=4, eventTime=1395195, downTime=1395185, deviceId=1, source=0x1002 }
2018-09-29 16:15:35.552 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2008.0703, y[0]=776.71484, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=9, eventTime=1395221, downTime=1395185, deviceId=1, source=0x1002 }
2018-09-29 16:15:35.569 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2007.8867, y[0]=776.25, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=3, eventTime=1395238, downTime=1395185, deviceId=1, source=0x1002 }
2018-09-29 16:15:35.594 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2008.0703, y[0]=775.6953, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=7, eventTime=1395263, downTime=1395185, deviceId=1, source=0x1002 }
2018-09-29 16:15:35.611 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2008.2578, y[0]=774.58594, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=6, eventTime=1395280, downTime=1395185, deviceId=1, source=0x1002 }
2018-09-29 16:15:35.624 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2008.3477, y[0]=773.28906, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=5, eventTime=1395295, downTime=1395185, deviceId=1, source=0x1002 }
2018-09-29 16:15:35.624 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=2008.3477, y[0]=773.28906, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1395297, downTime=1395185, deviceId=1, source=0x1002 }
2018-09-29 16:15:42.632 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=2018.3477, y[0]=1013.64453, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1402304, downTime=1402304, deviceId=1, source=0x1002 }
2018-09-29 16:15:42.643 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2018.5312, y[0]=1013.64453, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=2, eventTime=1402312, downTime=1402304, deviceId=1, source=0x1002 }
2018-09-29 16:15:42.660 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2018.1641, y[0]=1013.5508, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=6, eventTime=1402329, downTime=1402304, deviceId=1, source=0x1002 }
2018-09-29 16:15:42.668 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2018.1641, y[0]=1013.46094, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1402337, downTime=1402304, deviceId=1, source=0x1002 }
2018-09-29 16:15:42.669 2926-2926/com.  onTouchEvent:MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=2018.1641, y[0]=1013.46094, toolType[0]=TOOL_TYPE_STYLUS, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=1402342, downTime=1402304, deviceId=1, source=0x1002 }

Моя версия Chrome OS: 69.0.3497.95 (официальная сборка) (64-разрядная версия)

1 Ответ

0 голосов
/ 09 октября 2018

Команда Google подтвердила, что событие занято системой, приложение не может поймать это с текущим API.

...