all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* super and hyper keys acting funny in emacs
@ 2013-06-21 20:31 J. David Boyd
  2013-06-21 21:56 ` Peter Dyballa
  2013-06-22 15:35 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: J. David Boyd @ 2013-06-21 20:31 UTC (permalink / raw)
  To: help-gnu-emacs


I'm running the latest 32 bit cygwin under windows 7, and having a funny
problem with my hyper and super keys when I run emacs.


I've got my xserver configured to set the windows keys on the keyboard to be
super, and the caps lock to by hyper.


The output from 'setxkbmap -print' is:

xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us+inet(pc105)+altwin(alt_super_win)+capslock(hyper)"       };
        xkb_geometry  { include "pc(pc105)"     };
};

and if I run XEV, and press capslock I get:

KeyPress event, serial 32, synthetic NO, window 0xc00001,
    root 0x131, subw 0x0, time 8145997, (504,324), root:(2162,400),
    state 0x0, keycode 66 (keysym 0xffed, Hyper_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0xc00001,
    root 0x131, subw 0x0, time 8146122, (504,324), root:(2162,400),
    state 0x40, keycode 66 (keysym 0xffed, Hyper_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False


and if I press Left Windows key I get:

KeyPress event, serial 32, synthetic NO, window 0xc00001,
    root 0x131, subw 0x0, time 8148993, (504,324), root:(2162,400),
    state 0x0, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0xc00001,
    root 0x131, subw 0x0, time 8149102, (504,324), root:(2162,400),
    state 0x40, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False



All perfect so far.  When I'm in a terminal, my keys look fine.

So, then I start up 'emacs -Q', and press C-h k, then, for example, Capslock-d,
(hyper-d) I get 'H-d is undefined'. Yeah!

Then I press C-h k, then Left-Win-d, (super-d), and I get 'H-d is undefined',
not 's-d is undefined', which is what I expected to see.

I've glanced through the src for emacs in what seems to be the pertinent
functions, but nothing jumps up at me that would cause emacs to combine the
setting for the Windows and CapsLock keys to be both be what CapsLock is set to.

Any ideas how I might resolve this?

Dave





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: super and hyper keys acting funny in emacs
  2013-06-21 20:31 super and hyper keys acting funny in emacs J. David Boyd
@ 2013-06-21 21:56 ` Peter Dyballa
  2013-06-22 15:35 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2013-06-21 21:56 UTC (permalink / raw)
  To: J. David Boyd; +Cc: help-gnu-emacs


Am 21.06.2013 um 22:31 schrieb J. David Boyd:

> Any ideas how I might resolve this?

Can you imagine that GNU Emacs is running with a windowing system and without a windowing system?

In real life this might be best explained with a car with gas and the same car without gas. Which one runs better? (Not in respect to the environment it which it might run or not.)

In the terminal emulation the terminal emulation receives all X events. And eats them. Or passes them in some way to programmes it hosts inside. This behaviour should be documented.

--
Greetings

  Pete

When Richard Stallman goes to the loo, he core dumps.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: super and hyper keys acting funny in emacs
  2013-06-21 20:31 super and hyper keys acting funny in emacs J. David Boyd
  2013-06-21 21:56 ` Peter Dyballa
@ 2013-06-22 15:35 ` Stefan Monnier
  2013-06-24 13:21   ` J. David Boyd
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2013-06-22 15:35 UTC (permalink / raw)
  To: help-gnu-emacs

>     state 0x40, keycode 66 (keysym 0xffed, Hyper_L), same_screen YES,
[...]
>     state 0x40, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,

Notice how the "state" is the same: both your Hyper_L and Super_L keys
are assigned to the same modifier (presumably "Hyper").
Take a look at the output of "xmodmap".

Yes, X11 has an additional level of mapping from what you expect: the
name of the key does not in itself determine if it's a modifier and
which modifier it is.  Instead, there's an additional mapping from keys
to modifiers.


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: super and hyper keys acting funny in emacs
  2013-06-22 15:35 ` Stefan Monnier
@ 2013-06-24 13:21   ` J. David Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: J. David Boyd @ 2013-06-24 13:21 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>     state 0x40, keycode 66 (keysym 0xffed, Hyper_L), same_screen YES,
> [...]
>>     state 0x40, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
>
> Notice how the "state" is the same: both your Hyper_L and Super_L keys
> are assigned to the same modifier (presumably "Hyper").
> Take a look at the output of "xmodmap".
>
> Yes, X11 has an additional level of mapping from what you expect: the
> name of the key does not in itself determine if it's a modifier and
> which modifier it is.  Instead, there's an additional mapping from keys
> to modifiers.
>
>
>         Stefan

Thanks for the tip.  I was able to create an .Xmodmap file, containing

keycode 115 = Super_L
remove mod4 = Super_L
add mod3 = Super_L
keycode 117 = Super_R
remove mod4 = Super_R
add mod3 = Super_R

and now, after running that, emacs sees Hyper and Super as different keys.
I'm very happy.

Dave




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-24 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-21 20:31 super and hyper keys acting funny in emacs J. David Boyd
2013-06-21 21:56 ` Peter Dyballa
2013-06-22 15:35 ` Stefan Monnier
2013-06-24 13:21   ` J. David Boyd

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.