-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (28 loc) · 1.01 KB
/
main.cpp
File metadata and controls
33 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*******************************************************************************
* *
* PrimeSense NiTE 2.0 - Simple Skeleton Sample *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
*******************************************************************************/
#include <iostream>
#include <string>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>
using namespace std;
int main(int argc, char** argv)
{
string str;
Display *display;
unsigned int keycode[2];
display = XOpenDisplay(NULL);
for(int i=0;argv[1][i]!=0;i++){
if(argv[1][i]!=' '){
keycode[0] = XKeysymToKeycode(display, XK_A+(argv[1][i]-'a'));
XTestFakeKeyEvent(display, keycode[0], True, 0);
XTestFakeKeyEvent(display, keycode[0], False, 0);
}
}
XFlush(display);
return 0;
}