Sponsored Content
Full Discussion: xlib and keyboard events
Top Forums UNIX for Advanced & Expert Users xlib and keyboard events Post 302721633 by DGPickett on Thursday 25th of October 2012 03:25:13 PM
Old 10-25-2012
Yes, but a tty solution works a it more simply, in an xterm or not. For the input side of your requirement, I do not see any requirement for X expertise to write such an app. Keeping things as simple as possible is usually a good thing. You can even script it:
Code:
$ stty raw -echo ; cat -uvte | line ; stty -raw echo
1234^M^C^D$
           $

There are good tutorials out there for just about everything: http://tronche.com/gui/x/xlib/input/
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How can I map Unix keyboard for PC keyboard

A Solaris AXI 440 machine with Solaris 8 version. I have PC users who use an emulation to login to the Solaris server. How can I change the keyboard mapping of the Sun keyboard to fit to the PC keyboard ? Any comment will be appreciated. Thanks (1 Reply)
Discussion started by: simhab
1 Replies

2. Programming

How to get capture input events from keyboard and mouse

Hi, Is there any way to capture/record the input events from keyboard, as well as from mouse using C. Thanks in advance (4 Replies)
Discussion started by: yhacks
4 Replies

3. Programming

Xlib mouse events and ButtonPressMask

I have written a simple program which will report key press and release events for a particular window. In my case, it is mostly the terminal since I invoke the program from the terminal. I am able to get the key press and release events taking place in the terminal window (I have used... (0 Replies)
Discussion started by: abhinav.zoso
0 Replies

4. UNIX for Dummies Questions & Answers

Problem getting vertical bar with British keyboard layout on US (physical) keyboard

Hi, I've got a bit of a ridiculous problem and wasn't sure where to post it. I need to use the vertical bar for piping in Bash but, as per the title, am using a UK layout on a US (physical) keyboard which doesn't have a key for it in the place I'd expect. I've tried using xbindkeys and Unicode... (7 Replies)
Discussion started by: crunchgargoyle
7 Replies

5. Programming

Xlib registering

hey, Im new to the linux world. Lately, I have tried to create a glx window with xlib, making it a popup window(fullscreen) so I set override_redirect to true. Im happy with the removed borders, but apparantly, the application doesnt show up in the left bar in ubuntu, neither when I press alt... (4 Replies)
Discussion started by: thedardanius
4 Replies
STTY(1) 						      General Commands Manual							   STTY(1)

NAME
stty - set terminal parameters SYNOPSIS
stty [-ag] stty encoded-form stty speed ispeed speed ospeed speed cs5 cs6 cs7 cs8 [-]parenb [-]parodd [-]hupcl [-]cstopb [-]cread [-]clocal [-]ignbrk [-]brkint [-]ign- par [-]parmrk [-]inpck [-]istrip [-]inlcr [-]igncr [-]icrnl [-]ixon [-]ixoff [-]ixany [-]opost [-]onlcr [-]xtabs [-]onoeot [-]isig [-]icanon [-]iexten [-]echo [-]echoe [-]echok [-]echonl [-]noflsh [-]lflusho eof=c eol=c erase=c erase=c intr=c kill=c quit=c susp=c start=c stop=c rprnt=c lnext=c flush=c min=n time=n rows n cols n cooked raw [-]evenp [-]parity [-]oddp [-]nl ek sane DESCRIPTION
Stty shows or changes the parameters of the terminal connected to standard input. Stty takes a myriad of arguments most of which are mapped directly to the flags and special characters described in tty(4), so we won't describe them here. Stty has three forms of operation. First, without any arguments stty shows all terminal attributes that are different from the default state. Option -a makes stty print all terminal attributes, and -g lets stty print the attributes in a special encoded form, a simple row of colon separated hexadecimal numbers. In the second form of operation stty takes an encoded form as produced by the -g option and sets the terminals attributes to its decoded value. In the third form stty interprets a series of flags and parameters settings and modifies the terminal attributes accordingly. Flags can be given as icanon or -icanon for instance, either setting or clearing the ICANON flag. Special character values can by set like intr=^C for example, which sets the interrupt character to CTRL-C. You can either use a real CTRL-C, or the two characters `^' and `C'. In any case it is probably necessary to use quotes to guard it from the shell: intr='^C'. A number alone is interpreted as a baud rate setting for both the input and output rate. The input or the output rate can be set sepa- rately with use of the ispeed and ospeed prefixes to the number. The character size can be set with cs5, cs6, cs7 or cs8. The MIN and TIME value, and the number of rows and columns of the window can also be set using one of the keywords min, time, rows or cols, followed by a decimal number that is the value of the setting. Stty accepts several keywords that are not named by corresponding flags or parameters in tty(4). They set several attributes at once: cooked Same as icrnl ixon opost onlcr isig icanon iexten echo, setting all the attributes that are needed for line oriented mode. raw Same as -icrnl -ixon -opost -onlcr -isig -icanon -iexten -echo, setting all the attributes for a raw data channel. evenp parity These synonyms are equal to cs7 parenb -parodd, setting the line to 7 bits even parity. oddp Same as cs7 parenb parodd, setting the line to 7 bits odd parity. -parity -evenp -oddp All synonyms for cs8 -parenb, setting the line to 8 bits, no parity. nl Same as icrnl, setting carriage return to line feed input translation. -nl Same as -icrnl -inlcr -igncr, disabling any carriage return or line feed handling. ek Set the ERASE and KILL special characters back to the default. sane Set all attributes to the default except things like the line speed and parity, because their "sane" value is probably what it is right now. The default values are compiled into stty from the <termios.h> include file. Use stty sane; stty -a to know what they are. FILES
/etc/ttytab The init field of this file may contain an stty command to set the attributes to match an attached RS232 terminal or modem. SEE ALSO
tty(4), ttytab(5). NOTES
The cooked, raw, rows and cols keywords are Minix additions beyond the keywords defined by POSIX. Rows and cols are common UNIX exten- sions, however. There are more Minix specific flags that match the Minix specific attributes described in tty(4). AUTHOR
Kees J. Bot (kjb@cs.vu.nl) STTY(1)
All times are GMT -4. The time now is 08:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy