I wanted to use the SendInput function from the windows Api in nodejs, using the FFI package.
My knowledge of C is limited so I can\'t really figure out what problem
The "1" tells you that 1 event was inserted, not what the event actually is. I don't know about FFI but it seems to me that keyboardInput has some invalid type definitions. wVK and wScan must be 16-bit integers (hence the 'w' for WORD). Since they are typed the same as dwFlags (an 'int') that's cause invalid input values.