Posts

Showing posts from November, 2010

[Linux] X11 Xwindow Keyboard Event

為了與UX溝通,用了一招蠢方法,發送Keyboard event到UX,原本想建一個虛擬的Keyboard node,一直建不起來,沒想到可以從X11下手,X11可以看成一個application,這支程式就是對X11下keyevent。 Compiler using gcc -o xsendkey -lX11 xsendkey.c #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef WIN32 # include 'windows_x11.h' #else # define NeedFunctionPrototypes 1 # include <X11/Xlib.h> # include <X11/keysym.h> # if XlibSpecificationRelease != 6 # error Requires X11R6 # endif #endif static char *progname = NULL; static char *displayname = NULL; static Window window = 0; static Display *display = NULL; static char keyname[1024]; static int shift = 0; static int keysym = 0; int MyErrorHandler(Display *my_display, XErrorEvent *event) { fprintf(stderr, '%s: XSendEvent(0x%lx) failed.\n', progname, window); return 1; } void SendEvent(XKeyEvent *event) { XSync(display, False); XSetErrorHandler(MyErrorHandler); XSendEven...

[MeeGo] qmake Compiler

qmake安裝: libqt4-dev qt3-dev-tools qmake Compiler: qmake -project XXX.cpp (產生檔案.cpp的專案檔) qmake XXX.pro (產生make file) make ./XXX

[Linux] Modify brightness

Path /sys/devices/virtual/backlight/acpi_video0 抓brightness最大值 cat max_brightness 抓brightness目前值 cat brightness 更改brightness值 echo 1 > brightness