Skip to content

Instantly share code, notes, and snippets.

@etcwilde
Created June 24, 2015 15:29
Show Gist options
  • Save etcwilde/4210455e8fb2584e049d to your computer and use it in GitHub Desktop.
Save etcwilde/4210455e8fb2584e049d to your computer and use it in GitHub Desktop.
Keyboard Utility
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>
#include <stdio.h>
// Send data to keyboard
// This is for my IBM rapid access 1 keyboard media key support
// To activate all keys:
//
// sudo ./keyboard_send ea 71
//
int main(int argc, char* argv[])
{
int i;
ioperm(0x60, 3, 1);
for (i = 1; i < argc; i++)
{
int x = strtol(argv[i], 0, 16);
usleep(300);
outb(x, 0x60);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment