MCPcopy Create free account
hub / github.com/clementgallet/libTAS / write_evdev

Function write_evdev

src/library/inputs/evdev.cpp:98–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void write_evdev(struct input_event ev, int evnum)
99{
100 if (evdevfds[evnum].second == 0)
101 return;
102
103 /* Check pipe size and don't write if too big */
104 int pipeSize;
105 NATIVECALL(MYASSERT(ioctl(evdevfds[evnum].first.first, FIONREAD, &pipeSize) == 0));
106
107 if (pipeSize < static_cast<int>(64*sizeof(ev)))
108 write(evdevfds[evnum].first.second, &ev, sizeof(ev));
109 else {
110 LOG(LL_WARN, LCF_JOYSTICK, "did not write evdev event, too many already.");
111 }
112}
113
114bool sync_evdev(int evnum)
115{

Callers 2

generateControllerEventsFunction · 0.85
syncControllerEventsFunction · 0.85

Calls 1

ioctlFunction · 0.85

Tested by

no test coverage detected