f



Mapping a key to a control character

Is there a way to map a key to an arbitrary control character in
X ? xmodmap keycode expects a keysym and I don't know any
keysyms for which XLookupString() would return a control
character other than ^H, ^I, ^M, ^[ or ^?.

-- 
Andr� Majorel http://www.teaser.fr/~amajorel/
It is difficult to get a man to understand something, when his
salary depends upon his not understanding it. -- Upton Sinclair
0
Andre
7/17/2015 8:54:15 AM
comp.windows.x 1388 articles. 1 followers. Post Follow

4 Replies
324 Views

Similar Articles

[PageSpeed] 46

Andre Majorel <cheney@halliburton.com> asked:
> Is there a way to map a key to an arbitrary control character in
> X ? xmodmap keycode expects a keysym and I don't know any
> keysyms for which XLookupString() would return a control
> character other than ^H, ^I, ^M, ^[ or ^?.

[There are others: see your <X11/keysymdef.h>.]

Perhaps run a program that calls XRebindKeysym() to map some KeySym your
keyboard never generates to whatever string you wish, and then use
xmodmap to map your chosen key to that KeySym?  [If there's a standard
program for doing XRebindKeysym()s, I don't happen to know of it.]

The description of XLookupString() indicates that it checks for and
returns XRebindKeySym definitions before applying the "standard
interpretation".

I've never tried this and don't know if it would work.  I'm also not
sure whether the rebinding would apply globally (after the program
exits) or only to the program that did the rebinding (i.e., useless for
what you want).

HTH,
 -WBE
0
Winston
7/18/2015 8:29:41 PM
On 2015-07-18, Winston <wbe@UBEBLOCK.psr.com.invalid> wrote:
> Andre Majorel <cheney@halliburton.com> asked:
>> Is there a way to map a key to an arbitrary control character in
>> X ? xmodmap keycode expects a keysym and I don't know any
>> keysyms for which XLookupString() would return a control
>> character other than ^H, ^I, ^M, ^[ or ^?.
>
> [There are others: see your <X11/keysymdef.h>.]

All right, I forgot those : Linefeed = ^J, Clear = ^K. If you
know others, please enlighten me.

> Perhaps run a program that calls XRebindKeysym() to map some KeySym your
> keyboard never generates to whatever string you wish, and then use
> xmodmap to map your chosen key to that KeySym?
>
> The description of XLookupString() indicates that it checks for and
> returns XRebindKeySym definitions before applying the "standard
> interpretation".
>
> I've never tried this and don't know if it would work.  I'm also not
> sure whether the rebinding would apply globally (after the program
> exits) or only to the program that did the rebinding (i.e., useless for
> what you want).

All the sources I've found say that XRebindKeysym() only affects
the client that calls it so I didn't even try.

> [If there's a standard program for doing XRebindKeysym()s, I
> don't happen to know of it.]

I thought one was mentioned in one of the O'Reilly X books but I
can't find it now. There's example 9-5 in Adrian Nye's /Xlib
programming manual/, but it's just a code fragment, not a full
program.

-- 
Andr� Majorel http://www.teaser.fr/~amajorel/
It is difficult to get a man to understand something, when his
salary depends upon his not understanding it. -- Upton Sinclair
0
Andre
7/19/2015 7:24:04 AM
In article <slrnmqhgln.dmd.cheney@atc5.vermine.org>,
Andre Majorel  <cheney@halliburton.com> wrote:
>Is there a way to map a key to an arbitrary control character in
>X ? xmodmap keycode expects a keysym and I don't know any
>keysyms for which XLookupString() would return a control
>character other than ^H, ^I, ^M, ^[ or ^?.

Using a two-digit decimal number as the keysym appears to give
you the corresponding ascii character.  For example, on my Mac
this command maps the "q" key to control-A:

  xmodmap -e "keycode 20 = 01"

-- Richard

0
richard
7/20/2015 10:54:59 PM
On 2015-07-20, Richard Tobin <richard@cogsci.ed.ac.uk> wrote:
> In article <slrnmqhgln.dmd.cheney@atc5.vermine.org>,
> Andre Majorel  <cheney@halliburton.com> wrote:
>>Is there a way to map a key to an arbitrary control character in
>>X ? xmodmap keycode expects a keysym and I don't know any
>>keysyms for which XLookupString() would return a control
>>character other than ^H, ^I, ^M, ^[ or ^?.
>
> Using a two-digit decimal number as the keysym appears to give
> you the corresponding ascii character.  For example, on my Mac
> this command maps the "q" key to control-A:
>
>   xmodmap -e "keycode 20 = 01"

Works on Xorg 7.7 on a PC.

If the first hex digit is not [0-9], you get EG "bad keysym name
'ff' in keysym list". To avoid this, prefix with "0x" :

  xmodmap -e 'keycode 133 = 0xff'

Values under 1 or above 255 lead to an empty XLookupString().

None of that is documented, of course. Good catch !

Thanks.

-- 
Andr� Majorel http://www.teaser.fr/~amajorel/
It is difficult to get a man to understand something, when his
salary depends upon his not understanding it. -- Upton Sinclair
0
Andre
7/21/2015 5:52:44 AM
Reply:

Similar Artilces:

Displaying control characters in X-windows
DECterm can't, but DECW$TPU can. So, how does one go about displaying control characters in a text window ? For instance, if I write an application that displays contents of printer setup modules, I would very much want to be able to provide a visual representation of the control characters in it. Any hints on how this is done ? JF Mezei wrote: > DECterm can't, but DECW$TPU can. > > So, how does one go about displaying control characters in a text > window ? > > For instance, if I write an application that displays contents of > printer setup modules, I woul...

Req: Windows software to map MIDI controller data to (ASCII) keys
Hello guys, I am looking for a very simple MIDI utility for Windows (XP) that will do the following: - Monitor a MIDI input - Convert incoming MIDI (controller) data to keys or key combos - keys as in "Alphanumerical keyboard", not our ebony and ivory kind :) What I actually want to achieve this way is very simple: Use the sustain pedal on my MIDI keyboard - or maybe add one of those MIDI pedal boards - to emulate the ALT, CTRL or SHIFT keys on a standard PC keyboard. I Googled around, but could not find anything. Any ideas? ...

map(x->map(y->map(f,y),x),A);
Is there an easier way to obtain the results of computations like the following? >A:={ { [1,2],[3,4] } , { [5,6],[7,8] } }: > map(x->map(y->map(f,y),x),A); { {[f(1), f(2)], [f(3), f(4)]}, {[f(5), f(6)], [f(7), f(8)]} } --I would appreciate any conceptually simpler ways of doing this. Too many nested maps makes me dizzy. --Edwin Edwin Clark <wclark1@tampabay.rr.com> writes: > Is there an easier way to obtain the results of computations like the > following? > > >>A:={ { [1,2],[3,4] } , { [5,6],[7,8] } }: >> map(x->...

=?windows-1256?B?x+HFzMfIx8ogx+Hk4+bQzO3lIOHF48rNx+Qg?= =?windows-1256?B?x+HK3cfW4SDmx+HK38fj4SDh4dXdIMfhy8fhyyDH4cs=?= =?windows-1256?B?x+Tm7SAyMDEz?=
x+HFzMfIx8ogx+Hk4+bQzO3lIOHF48rNx+Qgx+HK3cfW4SDmx+HK38fj4SDh4dXdIMfhy8fhyyDH 4cvH5ObtIDIwMTMKCmh0dHA6Ly9tcmhvc3NhbWFsYWdteS5pbmZvLz9wPTgzOA== ...

map windows-keys
Hi I was wondering.. it kinda bothers me that I have three keys (the windows-keys) on my keyboard that I don't use. and the only keyboards I have without the windows-keys are azerty.. I want to stay with my qwerty-one. Is it possible to map those keys to open eg. links so they at least have /a/ function? or is it better that I start breaking amd melting some plastic to get them off my keyboard? I'm using knoppix without X (tty) Thanks in advance Theo Vermeulen -- Theo Vermeulen nospam@patat.org E-mailaddress is _not_ fake. #EOF ...

=?windows-1256?B?x+HI0eTH48wgx+HKz9HtyOwgOiDH4crd5u3WIA==?= =?windows-1256?B?x+HFz8fR7SDm48/O4SDKzd3t0iDH4ePRxObT7eQgx9M=?= =?windows-1256?B?2OTI5uEgLSDK0d/txyDO4cfhIMfh3crRySDj5CAxMCDH4ew=?= =?window
ys/a5t/jIMfhz8fRIMfh2tHI7ckg4eHK5OPtySDH4cXPx9HtySAKyMXayuPHzzogx+Hj2uXPIMfh w+bR5sjsIOHjz9HHwSDH4cPa48fhIEVJQk0KRXVyb3BlYW4gSW5zdGl0dXRlIGZvciBidXNpbmVz cyBtYW5hZ2Vycwrhzdbm0SAox+HI0eTH48wgx+HKz9HtyOwpCsfhyt3m7dYgx+HFz8fR7SDm48/O 4SDKzd3t0iDH4ePRxObT7eQK497RIMfhxeTa3sfPOiDH09jkyObhIJYgytHf7ccKzuHH4SDH4d3K 0ckg4+QgMTAgx+HsIDE0IOTm3ePI0SAyMDEzCu3e7eTH8CDIw+Qg4+XH0ckgx+HK3ebt1iDj5CDH 4ePlx9HHyiDH4d7tx8/tySDH4eXH48kg5uPkIMPl4yDj5sfV3cfKIMfh3sfGzyDH4cXPx9HtIMfh 5MfMzaEg5sPkIMfh48/t0SDH4dDtIO3KzOUgxeHsIMrd5u3WIMja1iDV4cfN7cfK5SDF4ewg49PH 2s/t5SDD5iDjz+3R7SDFz8fRyuUgx+Hm09jsIOTMzyDF5CDUztXtyu...

=?windows-1256?B?x+HI0eTH48wgx+HKz9HtyO06ICjH4crN4e3hIA==?= =?windows-1256?B?x+Hjx+HtIObH4ePNx9PI7SDh4c3Tx8jHyiDH4c7Kxw==?= =?windows-1256?B?4+3JIObex8bjySDH4ePR39Igx+Hjx+HtKSAg38fSyOHH?= =?windows-12
x+HHys3HzyDH4drRyO0g4crk4+3JIMfh4+bH0c8gx+HI1NHtyQrmzc/JIMfhyNHH48wg5ubR1CDH 4drj4QoKx+HT4cfjINrh7d/jIObRzePJIMfh4eUg5sjR38fK5aGhoQrtytTR3SDH4cfKzcfPIMfh 2tHI7SDhyuTj7ckgx+Hj5sfRzyDH4cjU0e3JIMPkIO3N7dgg09rHz8rf4yDa4ePH8CDD5OU6CsjH 4crax+bkIOPaCuPR39IgyuTj7ckgx+Hj5sfRzyDH4djI7drtySDmx+HI1NHtySDI49rlzyDH4cjN 5ssg5sfhz9HH08fKIMfhxd3R7d7tyQogKCDMx+PaySDH4d7H5dzc3Nzc3Nzc3NzRySApCtrS4yDa 4ewgx+HI0eTH48wgx+HKz9HtyO06Csfhys3h7eEgx+Hjx+HtIObH4ePNx9PI7SAK4eHN08fIx8og x+HOysfj7ckg5t7HxuPJIMfh49Hf0iDH4ePH4e0K38fSyOHH5N/HIJYgx+Hj4+HfySDH4ePb0cjt ySDO4cfhIMfh3crRySDj5CAyMi0yNiAg08jK48jRIDIwMTPjCsjlz9...

=?windows-1256?B?x+HI0eTH48wgx+HKz9HtyO06ICjH4crN4e3hIA==?= =?windows-1256?B?x+Hjx+HtIObH4ePNx9PI7SDh4c3Tx8jHyiDH4c7Kxw==?= =?windows-1256?B?4+3JIObex8bjySDH4ePR39Igx+Hjx+HtKSAg38fSyOHH?= =?windows-12
x+HHys3HzyDH4drRyO0g4crk4+3JIMfh4+bH0c8gx+HI1NHtyQrmzc/JIMfhyNHH48wg5ubR1CDH 4drj4QoKx+HT4cfjINrh7d/jIObRzePJIMfh4eUg5sjR38fK5aGhoQrtytTR3SDH4cfKzcfPIMfh 2tHI7SDhyuTj7ckgx+Hj5sfRzyDH4cjU0e3JIMPkIO3N7dgg09rHz8rf4yDa4ePH8CDD5OU6CsjH 4crax+bkIOPaCuPR39IgyuT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KaHR0cDovL25hdGlndGFzN2FiLmJsb2dzcG90 LmNvbS8yMDEzLzA1L2Jsb2ctcG9zdF83NDk3Lmh0bWw= ...

=?windows-1256?B?x+HKx8jhyiDH4ePV0ewgxe3kx9EgyMre5O3JIA==?= =?windows-1256?B?w+Hjx+TtySDtyMfaIMjd0ebaIOPmyO3k7eEg5iDHytU=?= =?windows-1256?B?x+HHyiDH4e3f4yDj5sfV3cfK5SDm09rR5Q==?=
x+HKx8jhyiDH4ePV0ewgxe3kx9EgyMre5O3JIMPh48fk7ckg7cjH2iDI3dHm2iDj5sjt5O3hIOYg x8rVx+HHyiDH4e3f4wrj5sfV3cfK5SDm09rR5QoKaHR0cDovL25hdGlndGFzN2FiLmJsb2dzcG90 LmNvbS8yMDEzLzA1L2Jsb2ctcG9zdF83NDk3Lmh0bWw= ...

keyboard control in X windows
I am trying to use the PerlMagick API to the ImageMagick suite to write a program to view pictures. The pictures to be viewed are collected in a directory, and I want to be able to step thru them, in sequence, using the keyboard. The pictures are not viewable with the likes of "gthumb", but ImageMagick reads them well. The problem is that once I call the ImageMagick "Display()" function, the output of the keyboard no longer goes to the program, until the window that "Display()" opened is closed. I don't have much (any, really) X-windows programming experien...

to control key in map stl
How can I control if key in stl map exist? I have a map<Point3i,bool> mapPoint; I would like control if a point mapPoint[Poin3i(1,1,1)] already exist. How can I do this? An information about map stl. What is time to insert a Point3i and what is time to access to itself Point3i? Thanks. antani wrote: > How can I control if key in stl map exist? > > I have a map<Point3i,bool> mapPoint; > > I would like control if a point mapPoint[Poin3i(1,1,1)] already exist. > How can I do this? > > An information about map stl. > What is time to insert a Point3i ...

Web resources about - Mapping a key to a control character - comp.windows.x

List of Killzone characters - Wikipedia, the free encyclopedia
Cpl. Dante Garza is a loyal, optimistic and likable character- an effective team player. A close companion of Sev, the pair have served together ...

Digimon World -Next 0rder- Game's Trailer Previews Characters, System
Eir Aoi contributed theme song for game shipping March 17 in Japan

Stephen Curry Is A Fictional Character From Planet X
One of baseball’s last remaining virtues is that the maxim “Watch any baseball game, and you’ll see something you’ve never seen before” is generally ...

'Mortal Kombat XL' is loaded with characters and skin packs
NetherRealm's found a new way to milk its beloved creation Mortal Kombat X. Today, the studio revealed a version of the title dubbed Mortal Kombat ...

Kristen Wiig's Terrifying 'Zoolander No. 2' Character Promotes 'Youth Milk' in New Teaser
Kristen Wiig's Terrifying 'Zoolander No. 2' Character Promotes 'Youth Milk' in New Teaser

Weibo Beats Twitter To Raising Its 140-Character Limit
The Chinese microblogging service is raising its posting limit to 2,000 characters China's Twitter, Weibo, has beat the original to the punch ...

The Free 'Black Desert' Character Creator Is Actually Pretty Disappointing
The Free 'Black Desert' Character Creator Is Actually Pretty Disappointing

Sorry PC fans, New Mortal Kombat X characters and skins are for consoles only
Earlier this week we noted the upcoming release of Mortal Kombat XL, a new edition of last year’s popular and gory fighter that includes all ...

Shadowhunters' Only Reasonable Character is Magnus the Snazzy Warlock
... Clary and company making multiple attempts to jog her memories and hopefully get closer to saving her mother and the world. But the only character ...

‘Guardians of the Galaxy 2’: New Marvel Movie Characters Great And Small Revealed
... 22, 2016 Now its been rumored that Ego the Living Planet will be in the movie and if this is true, this could be quite an interesting character ...

Resources last updated: 1/25/2016 11:01:28 AM