x11

How to change Keyboard Layout (a X11 API solution)

无人久伴 提交于 2019-11-29 05:14:46
I want to change keyboard layout in Linux by programming, What X11's API function does this? S. Razi I found one good solution. It's a c++ class wrriten by Jay Bromley, that I can add to my app and using it. source code It's very easy to use: #include "XKeyboard.h" XKeyboard xkb; std::string cGrpName=xkb.currentGroupName(); //return somethings like "USA" std::string cGrpSymb=xkb.currentGroupSymbol(); //return somethings like "us" xkb.setGroupByNum(0);//set keyboard layout to first layout in available ones you can read source code and found some another useful functions. for compiling

to create X window(X11) in java swing and to get its id

佐手、 提交于 2019-11-29 05:11:31
Can anyone help me in creating an X11 window in java swing using eclipse?And also the function to get the x11 id also.What are the basic requirement for creating an X11 window in java. Tom answered the first part of your question. The second part of the answer is: to get the id of an X11 window you are going to have to use native code (code written in C or C++) and access it through the JNI interface. You may have to run a search by title through all existing windows to get the one you desire. Here is a recursive function that will search (starting from the root window) for a window with the

Global Hotkey in Mono and Gtk#

佐手、 提交于 2019-11-29 05:02:56
I'm trying to get a global hotkey working in Linux using Mono. I found the signatures of XGrabKey and XUngrabKey , but I can't seem to get them working. Whenever I try to invoke XGrabKey , the application crashes with a SIGSEGV. This is what I have so far: using System; using Gtk; using System.Runtime.InteropServices; namespace GTKTest { class MainClass { const int GrabModeAsync = 1; public static void Main(string[] args) { Application.Init(); MainWindow win = new MainWindow(); win.Show(); // Crashes here XGrabKey( win.Display.Handle, (int)Gdk.Key.A, (uint)KeyMasks.ShiftMask, win.Handle, true,

Listening to keyboard events without consuming them in X11 - Keyboard hooking

旧巷老猫 提交于 2019-11-29 04:26:05
I tried to write a program which hooks keyboard messages to pronounce the name of each key whenever it is pressed in Ubuntu (KDE); without interfering with normal action of keyboard in programs (just announcing the key name). This is my program: #include <X11/Xlib.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> using namespace std; void SendPressKeyEvent(Display *display, XKeyEvent xkey) { Window current_focus_window; int current_focus_revert; XGetInputFocus(display, &current_focus_window, &current_focus_revert); xkey.type = KeyPress; xkey.display = display;

Xlib and Firefox behavior

感情迁移 提交于 2019-11-29 04:22:42
问题 I'm trying to create a small window manager (just for fun), but I'm having problems in handling windows created by Firefox (only with that application, other apps works fine) The problem is, after I launch Firefox, and add my decoration, it seems to work fine, but if for example I try to click on the menu button, the (sub)window doesn't appear. What seems to happen is that after the click, a ClientMessage event is fired with the following values: Data: (null) Data: _NET_WM_STATE_HIDDEN Data:

X11 - Draw on Overlay Window

≯℡__Kan透↙ 提交于 2019-11-29 02:26:19
I want to draw simple primitives at specific pixels on the screen (similar to this question ). In order to do that I draw on top of all windows using the Overlay Window of the Window Manager. I can see the shape I am drawing and mouse events pass through but I don't see for example Window movements that are below the Overlay Window (unless I kill my application). I am new to Xlib programming, sry for asking a maybe simple question. #include <assert.h> #include <stdio.h> #include <X11/Xlib.h> #include <X11/extensions/Xcomposite.h> #include <X11/extensions/Xfixes.h> #include <X11/extensions

“X11/Xlib.h”: no such file or directory on mac os x mountain lion

时光总嘲笑我的痴心妄想 提交于 2019-11-29 01:33:33
I came across this when I was compiling a simple program: #include <X11/Xlib.h> #include <stdio.h> #include <stdlib.h> Display* display; int main(){ display = XOpenDisplay(""); if (display == NULL) { printf("Cannot connect\n"); exit (-1); } else{ printf("Success!\n"); XCloseDisplay(display); } } FYI, I have xQuartz installed. I compile this program with "g++ -o ex ex.cpp -L/usr/X11R6/lib -lX11" command. you need to compile with: g++ -o ex ex.cpp -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 the X11 headers are installed with xQuartz , but you need to reference them explicitly If you install

Can't find x11 terminal in gnuplot Octave on Mac OS

拜拜、爱过 提交于 2019-11-28 22:13:34
问题 I am running Mac OS Mavericks 10.9.4. Installed Octave 3.8.1 via Homebrew which came with gnuplot 4.6 Have XQuartz 2.7.6 installed. I restarted my computer after all was done. In order to plot in octave-cli everyone states that I should just 'set terminal x11' BUT I don't even have x11 listed when I run 'set terminal' in gnuplot Of course octave-cli will complain that my terminal is unknown. octave:1> x=1; octave:2> plot(x); gnuplot> set terminal aqua enhanced title "Figure 1" size 560 420

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

余生长醉 提交于 2019-11-28 20:47:33
I get the following error trying to install Scrapy in a Mavericks OS. I have command line tools and X11 installed I don't really know whats going on and I haven`t found the same error browsing through the Web. I think it might be related to some change in Xcode 5.1 Thanks for the answers! this is part of the command output: $pip install scrapy . . . . Downloading/unpacking cryptography>=0.2.1 (from pyOpenSSL->scrapy) Downloading cryptography-0.3.tar.gz (208kB): 208kB downloaded Running setup.py egg_info for package cryptography OS/X: confusion between 'cc' versus 'gcc' (see issue 123) will not

Why XGrabKey generates extra focus-out and focus-in events?

此生再无相见时 提交于 2019-11-28 20:06:49
Does anyone know an xlib function to trap a keypress event without losing the original focus? How to get rid of it? (or "to use XGrabKey() without generating Grab-style focusout"?) (or "How to get rid of NotifyGrab and NotifyUngrab focus events at system level?) The XGrabKey will lose focus on key pressed and restore focus on key released. And I want to trap the keypress without leak it to the original window (just as XGrabKey can do it). References: ...XGrabKey will steal focus... https://bugs.launchpad.net/gtkhotkey/+bug/390552/comments/8 ...The program receives control to do something in