I would like to watch STDIN by libev.
import selectors
let events = newSelector[int]()
events.registerHandle( stdin.getFileHandle(), {Event.Read}, 0)
And I got this error.
Error: type mismatch
proc registerHandle[T](s: Selector[T]; fd: int | SocketHandle;
events: set[Event]; data: T)
first type mismatch at position: 2
required type for fd: int or SocketHandle
but expression 'getFileHandle(stdin)' is of type: FileHandle
Converting FileHandle into int also Fails.
...
events.registerHandle( stdin.getFileHandle().int , {Event.Read}, 0)
Error: type mismatch
proc setSelectKey[T](s: Selector[T]; fd: SocketHandle; events: set[Event];
data: T)
first type mismatch at position: 2
required type for fd: SocketHandle
but expression 'fd' is of type: int
A machine is on Windows10. Thank you.