octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39738] Keyboard events discarded if mouse poi


From: Cristian
Subject: [Octave-bug-tracker] [bug #39738] Keyboard events discarded if mouse pointer out of figure window
Date: Fri, 09 Aug 2013 14:36:50 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20100101 Firefox/10.0.12 Iceweasel/10.0.12

URL:
  <http://savannah.gnu.org/bugs/?39738>

                 Summary: Keyboard events discarded if mouse pointer out of
figure window
                 Project: GNU Octave
            Submitted by: r41nm4n
            Submitted on: Fri 09 Aug 2013 02:36:49 PM GMT
                Category: Plotting with OpenGL
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

If the mouse pointer is out of the figure window, all the events are
discarded, including keyboard events.

This happens according to the implementation of __init_fltk__.cc, as this code
snippet of the function "int handle (int event)" shows:


    // We only handle events which are in the canvas area.
    if (!Fl::event_inside (canvas))
      return retval;


However, this implies incorrect behaviour for the detection of events related
to key press and release, and key modifiers.

Such a wrong behaviour can be shown with the help of the following script:


imshow(0);
function DisplayKeys(~, e, press)
  if press
     disp('Key pressed:');
  else
     disp('Key released:');
  endif
  e
endfunction
set(gcf, 'KeyPressFcn', address@hidden, true});
set(gcf, 'KeyReleaseFcn', address@hidden, false});


Once the script is run, the wrong behaviour can be verified by following these
instructions:

1) go on the black square in the figure window with the mouse pointer, without
pressing any mouse button
2) press "alt" (or "ctrl", or "shift", ...) and keep it pressed
3) move the mouse pointer out of the figure window
4) release "alt" (or what was pressed at step 2)
5) move the mouse pointer back on the black square
6) press "1" (or any other number or letter)

At the console, then I get


e = scalar structure containing the fields:
      Character =  49
      Key =  49
      Modifier =
      {
        [1,1] = alt
      }


which shows that the keyboard event was detected as a key press with modifier
"alt", which is of course not correct. The correct result would be


e = scalar structure containing the fields:
      Character =  49
      Key =  49
      Modifier = {}(0x0)







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39738>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]