File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,11 @@ def get_service_name(udevreturn, input_dev):
3939 try :
4040 devpath = [line .split ("=" , 1 )[1 ] for line in udevreturn .splitlines ()
4141 if line .startswith ("DEVPATH=" )][0 ]
42- with open (f"/sys/{ devpath } /device/capabilities/abs" , "rb " ) as f :
43- abs_bytes = f .read ()
44- # we care about only the first byte - that's where X,Y axies are
45- abs_caps = abs_bytes [ 0 ]
46- except (IndexError , FileNotFoundError ):
42+ with open (f"/sys/{ devpath } /device/capabilities/abs" , "r " ) as f :
43+ abs_string = f .read (). strip ()
44+ # we care about only the last byte - that's where X,Y axies are
45+ abs_caps = int ( abs_string [ - 1 ])
46+ except (IndexError , FileNotFoundError , ValueError ):
4747 abs_caps = 0
4848 if (
4949 ('ID_INPUT_TABLET' in udevreturn ) or
You can’t perform that action at this time.
0 commit comments