Mapping problem (X.org X11)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Mapping problem (X.org X11)

Mike McNally-2
I don't think that what I'm having is a Vim problem, per se, but
I'm hopeful that somebody may have experienced what I'm seeing
for the same reasons I'm running into it, namely that I'm trying
to set up a Vim mapping.

I'm running 6.3 on a Linux x86 system, with the X.org server.

The problem I'm having is that certain CTRL-ALT-x key combinations
do not generate any sort of keycode for applications.  Specifically,
the chords <C-M-s>, <C-M-k>, and all the number keys (i.e. <C-M-0>
through <C-M-9>) generate an X "KeymapNotify" event instead of
a KeyPress/KeyRelease.  I see KeyPress and release for the modifier
keys, but not the "s" or "k" or number key.

Note that all the other keys work fine - I have working <C-M-x> mappings
for lots of things.

I've been looking through the "xkb" configuration stuff, but I don't
see anything in there that looks as if it'd have the effect I'm
seeing.

Any help or suggestions are appreciated.

--
[ you are my main foo ] Mike McNally -- [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mapping problem (X.org X11)

A.J.Mechelynck
Mike McNally wrote:

> I don't think that what I'm having is a Vim problem, per se, but
> I'm hopeful that somebody may have experienced what I'm seeing
> for the same reasons I'm running into it, namely that I'm trying
> to set up a Vim mapping.
>
> I'm running 6.3 on a Linux x86 system, with the X.org server.
>
> The problem I'm having is that certain CTRL-ALT-x key combinations
> do not generate any sort of keycode for applications.  Specifically,
> the chords <C-M-s>, <C-M-k>, and all the number keys (i.e. <C-M-0>
> through <C-M-9>) generate an X "KeymapNotify" event instead of
> a KeyPress/KeyRelease.  I see KeyPress and release for the modifier
> keys, but not the "s" or "k" or number key.
>
> Note that all the other keys work fine - I have working <C-M-x> mappings
> for lots of things.
>
> I've been looking through the "xkb" configuration stuff, but I don't
> see anything in there that looks as if it'd have the effect I'm
> seeing.
>
> Any help or suggestions are appreciated.
>
> --
> [ you are my main foo ] Mike McNally -- [hidden email]
>
>
>

Depending on your OS and/or on your keyboard interface, some keys or
keychords may or may not be visible to gvim.

Here is what I think I know:

"Printable" characters, lower-ASCII: letters, digits, space, some
"special" characters: 0x20 to 0x7E. These are always recognised AFAIK.
On most non-EBCDIC systems they are represented identically.

"Control" characters, lower-ASCII: 0x00 to 0x1F
--- On most systems, the Ctrl key together with a key for 0x40 to 0x5F
produces the same byte stripped of its 0x40 bit.
--- AFAIK, case (i.e., shift status) doesn't matter.
--- For Vim, Ctrl-[ is the same as Esc; Ctrl-I is the same as Tab;
Ctrl-M is the same as Enter; Ctrl-H is (usually) the same as Backspace.

"Printable" characters, upper-ASCII: 0xA0 to 0xFF. Accented letters,
some symbols. "National" keyboard have different sets of these,
depending on which accented letters are used in that language. Which
character is represented by which octet is encoding-dependent. Some or
all of these may be undistinguishable from Alt+lower-ASCII-printable,
depending on OS and/or keyboard driver.

"Keypad" and "Function" keys, also known as "Grey" keys: Left, Right,
Up, Down, PageUp, PageDown, Home, End, Insert, F1 to F12. These key
often function well with Shift, Ctrl, Alt, and various combinations of
them. Exactly which combinations may be OS-dependent.

Shift-Tab often works well.

"Del" key, 0x7F, also known as Ctrl+? (Control-Question-Mark). Somewhat
less portable than the above.

Non-printable (or non-officially-printable) characters, upper-ASCII:
0x80 to 0x9F: they don't always function perfectly. On some systems
these are obtained by Ctrl+Alt+ something in the set
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_

Combinations of Ctrl or Ctrl-Alt with printable characters in the set
!"#$%&'()*+,-./0123456789:;<=>? and Space function erratically, if at
all. Don't put any trust in them before testing them on the same machine
and in the same GUI or terminal.


Your best bet for easily recognisable mappings which won't clash with
something already used by Vim is to use F keys with or without various
combinations of Shift, Ctrl and/or Alt, with the exception of F1 used
alone (the Help key) and F10 used alone (the Menu key).


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mapping problem (X.org X11)

Mike McNally-2
> Depending on your OS and/or on your keyboard interface, some
> keys or keychords may or may not be visible to gvim.

I think that's what I'm trying to figure out.  There are some
chords of the form <C-M-x> that *do* work just fine, but for
reasons I don't understand some of them just don't.

On my keyboard, F* function keys are hard to type.


--
[ you are my main foo ] Mike McNally -- [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Mapping problem (X.org X11)

A.J.Mechelynck
Mike McNally wrote:
>>Depending on your OS and/or on your keyboard interface, some
>>keys or keychords may or may not be visible to gvim.
>
>
> I think that's what I'm trying to figure out.  There are some
> chords of the form <C-M-x> that *do* work just fine, but for
> reasons I don't understand some of them just don't.
>
> On my keyboard, F* function keys are hard to type.

Hard luck. On my laptop keyboard, they are slightly smaller than other
keys but with some training I have no problem with them.

>
>
> --
> [ you are my main foo ] Mike McNally -- [hidden email]
>
>
>

I'm not sure it answers to any understandable logic. Experiment will
tell. In Insert mode, Ctrl-V followed by some key or key combo will show
what Vim sees when you press that key or key combo; or if it sees
nothing, it will wait for something else (with ^V near the bottom-right
of your screen if you have 'showcmd' on).

(If you paste with Ctrl-V, use Ctrl-Q instead).

If you are creating scripts for use on other machines, limit yourself
(in mappings) to printable keys, Ctrl+ (one of letter, atsign, left or
right square bracket, backslash, caret or underline), keypad keys
possibly with Shift or Ctrl, and F keys with or without any of Shift,
Ctrl and Alt. (F1 and F10 are reserved.) Don't forget that key sequences
are mappable, creating user-specified "dead keys". For instance, if you
always follow a semicolon with a space, you might want to use a
semicolon not followed by a space as an usher for a mapping. (But if you
do that in Insert-mode mappings, your "true" semicolons will only be
visible after you type the following space, or after a timeout.) (In
Normal mode, the semicolon is an esoteric motion-repeat command which I
never use so I don't mind remapping it. YMMV.)


Best regards,
Tony.

Loading...