feat(protocol): negotiate display and native input
This commit is contained in:
@@ -37,6 +37,13 @@ def classify_input(raw: bytes) -> str:
|
||||
return "invalid:field"
|
||||
active_mask = int.from_bytes(body[1:3], "big")
|
||||
return "valid" if active_mask or not any(body[3:]) else "invalid:field"
|
||||
if kind == 6:
|
||||
if len(body) != 8:
|
||||
return "invalid:length"
|
||||
x, y, width, height = (int.from_bytes(body[index:index + 2], "big") for index in range(0, 8, 2))
|
||||
return "valid" if width and height and x < width and y < height else "invalid:field"
|
||||
if kind == 7:
|
||||
return "valid" if len(body) == 4 else "invalid:length"
|
||||
return "invalid:kind"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user