25 lines
347 B
Go
25 lines
347 B
Go
|
package evdev
|
||
|
|
||
|
// #cgo CFLAGS: -g -Wall
|
||
|
// #include "evdev.h"
|
||
|
// #include <stdlib.h>
|
||
|
import "C"
|
||
|
|
||
|
import (
|
||
|
"unsafe"
|
||
|
"syscall"
|
||
|
)
|
||
|
|
||
|
|
||
|
func BlockUntilKeypress(devicePath string) error {
|
||
|
path := C.CString(devicePath)
|
||
|
defer C.free(unsafe.Pointer(path))
|
||
|
|
||
|
ret := C.block_until_keypress(path)
|
||
|
if ret < 0 {
|
||
|
return syscall.Errno(ret)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|