mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
ea5517b270
* add xf86 input driver. * cleanup. * rewrite to unix socket PoC. * add input rebuild. * lint & docs. * add input driver struct. * comments, lint, socket name from config. * add touch events to webrtc. * switch to uint32. * misc update logging & linting, * fix screen size * set touchscreen as core pointer. * add touch to ws control. * SendCoreEvents. * extract to own xinput folder. * add debounce. * switch pressure to uint8. * check buffer size. * send touch events with system init.
49 lines
693 B
Go
49 lines
693 B
Go
package payload
|
|
|
|
import "math"
|
|
|
|
const (
|
|
OP_MOVE = 0x01
|
|
OP_SCROLL = 0x02
|
|
OP_KEY_DOWN = 0x03
|
|
OP_KEY_UP = 0x04
|
|
OP_BTN_DOWN = 0x05
|
|
OP_BTN_UP = 0x06
|
|
OP_PING = 0x07
|
|
// touch events
|
|
OP_TOUCH_BEGIN = 0x08
|
|
OP_TOUCH_UPDATE = 0x09
|
|
OP_TOUCH_END = 0x0a
|
|
)
|
|
|
|
type Move struct {
|
|
X uint16
|
|
Y uint16
|
|
}
|
|
|
|
type Scroll struct {
|
|
X int16
|
|
Y int16
|
|
}
|
|
|
|
type Key struct {
|
|
Key uint32
|
|
}
|
|
|
|
type Ping struct {
|
|
// client's timestamp split into two uint32
|
|
ClientTs1 uint32
|
|
ClientTs2 uint32
|
|
}
|
|
|
|
func (p Ping) ClientTs() uint64 {
|
|
return (uint64(p.ClientTs1) * uint64(math.MaxUint32)) + uint64(p.ClientTs2)
|
|
}
|
|
|
|
type Touch struct {
|
|
TouchId uint32
|
|
X int32
|
|
Y int32
|
|
Pressure uint8
|
|
}
|