disable touch when stylus is present
This commit is contained in:
@@ -29,6 +29,7 @@ wacom_height = 20967
|
|||||||
finger_width = 767
|
finger_width = 767
|
||||||
finger_height = 1023
|
finger_height = 1023
|
||||||
|
|
||||||
|
stylus_present = 0
|
||||||
|
|
||||||
# remap wacom coordinates to screen coordinates
|
# remap wacom coordinates to screen coordinates
|
||||||
def remap(x, y, wacom_width, wacom_height, monitor_width,
|
def remap(x, y, wacom_width, wacom_height, monitor_width,
|
||||||
@@ -73,9 +74,15 @@ def read_tablet(args, remote_device):
|
|||||||
monitor = get_monitors()[args.monitor]
|
monitor = get_monitors()[args.monitor]
|
||||||
log.debug('Chose monitor: {}'.format(monitor))
|
log.debug('Chose monitor: {}'.format(monitor))
|
||||||
|
|
||||||
|
global stylus_present
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
_, _, e_type, e_code, e_value = struct.unpack('2IHHi', remote_device.read(16))
|
_, _, e_type, e_code, e_value = struct.unpack('2IHHi', remote_device.read(16))
|
||||||
|
|
||||||
|
|
||||||
|
if e_type == 0x01 and e_code == 0x140:
|
||||||
|
stylus_present = e_value
|
||||||
|
|
||||||
if e_type == e_type_abs:
|
if e_type == e_type_abs:
|
||||||
|
|
||||||
# handle x direction
|
# handle x direction
|
||||||
@@ -143,10 +150,12 @@ def read_finger(args, remote_device):
|
|||||||
mt_list = {}
|
mt_list = {}
|
||||||
mt_slot = 0
|
mt_slot = 0
|
||||||
|
|
||||||
|
global stylus_present
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
_, _, e_type, e_code, e_value = struct.unpack('2IHHi', remote_device.read(16))
|
_, _, e_type, e_code, e_value = struct.unpack('2IHHi', remote_device.read(16))
|
||||||
|
|
||||||
if e_type == e_type_abs:
|
if e_type == e_type_abs and stylus_present == 0:
|
||||||
|
|
||||||
if e_code == evcode_finger_mv_slot:
|
if e_code == evcode_finger_mv_slot:
|
||||||
mt_slot = e_value
|
mt_slot = e_value
|
||||||
|
|||||||
Reference in New Issue
Block a user