Subject: bug#26104: 26.0.50; In Ubuntu, having mouse over other frame cause Alt key to produce a <switch-frame> event

From: Jonathan Ganc <[email-masked]>
Date: Thu, 6 Apr 2017 23:56:11 -0400

On 04/05/2017 02:58 AM, martin rudalics wrote:
>
> ‘yank-pop’ by itself does not query the mouse position so "pressing the
> Alt key produces a <switch-frame> event" as you said earlier does not
> describe what really happens.  Someone else must have changed
> `last-command' to `switch-frame' and it would be essential to find out
> who.  And, as a furthe clue, the event must have come from a mouse move
> since according to "the mouse is positioned over the other frame" this
> is the only thing you do in between ‘yank’ and ‘yank-pop’ and if you do
> not move the mouse in between them the M-y succeeds.  Or am I missing
> something?

switch-frame is produced when the Alt key is pressed (as soon as it is 
pressed, i.e. before the 'Y' is pressed). i can verify this by running 
'read-event`, which triggers and produces switch-frame as soon as Alt is 
pressed. Conversely, the event is still generated even if I disable both 
my mouse and trackpad, the only things which can produce mouse motion.

>
> If the above approach is inusfficient we indeed might have to add some
> extra code to make_lispy_switch_frame in order to find out what happens.
> In that case you have to be able to build Emacs on your machine.
>

I'm not averse to rebuilding emacs (I built the current version I'm 
using), if it could help.

I was trying to explore emacs input. One thing I've realized is that xev 
(i.e. if I monitor emacs using 'xev -id ...') does not see most keys 
(e.g. alphanumeric keys, Ctrl, shift) sent to emacs but it does see when 
Alt (or the Windows key) is pressed. So some keys are "special". I wish 
I knew about how emacs set this up.