Wacom Bamboo One CTE-660 |
Once you install xsetwacom utility, to calibrate(map) wacom tablet to left top most portion of 500X500 area of your screen, run the following command.
xsetwacom set "Wacom Bamboo1 5x8 stylus" MapToOutput 500X500+0+0
To calibrate(map) wacom tablet to entire scree run the following command
xsetwacom set "Wacom Bamboo1 5x8 stylus" MapToOutput VGA1
The following program creates a xwindow & by pressing 'm' key calibrates(map) Wacom Bamboo1 5x8 stylus to the created window and by pressing 'u' calibrates Wacom Bamboo1 5x8 stylus to entire screen.
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
#include <X11/keysym.h>
#include <X11/extensions/shape.h>
#define NIL (0)
int main()
{
char *window_name = (char*)"gem input window";
Display *dpy = XOpenDisplay(NIL);
int whiteColor = WhitePixel(dpy, DefaultScreen(dpy));
Window w = XCreateSimpleWindow(dpy, RootWindow(dpy, DefaultScreen(dpy)), 0, 0, 500, 500, 0, whiteColor, whiteColor);
XSelectInput(dpy, w, ButtonPressMask| PointerMotionMask| LeaveWindowMask| EnterWindowMask| ButtonReleaseMask );
XStoreName(dpy, w, window_name);
XMapWindow(dpy, w);
for(;;) {
XEvent e;
XNextEvent(dpy, &e);
if(e.xany.window == w)
{
switch(e.type)
{
case KeyPress:
{
printf("\n Calibration to 500X500 Done");
system("xsetwacom set \"Wacom Bamboo1 5x8 stylus\" MapToOutput 500X500+0+0");
}
if (e.xkey.keycode == XKeysymToKeycode(dpy, XK_u))
{
printf("\n Calibrating to entire screen Done");
system("xsetwacom set \"Wacom Bamboo1 5x8 stylus\" MapToOutput VGA1");
}
if (e.xkey.keycode == XKeysymToKeycode(dpy, XK_e))
XDestroyWindow(dpy, w);
break;
}
}
}
return 0;
}
No comments:
Post a Comment