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

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

[Octave-bug-tracker] [bug #44834] [OpenGL] ginput doesn't return proper


From: Rik
Subject: [Octave-bug-tracker] [bug #44834] [OpenGL] ginput doesn't return proper (X, Y) coordinates for key press
Date: Tue, 14 Apr 2015 19:18:12 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0

Update of bug #44834 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

Confirmed.  Although what it appears to do is simply return the coordinates of
the last mouse button press (maybe initialized to 0,0 if there has bee no
mouse button yet).

This will have to be fixed separatel for the FLTK toolkit and for the Qt
toolkit.

For the FLTK toolkit the file is libinterp/dldfcn/__init_fltk__.cc.  The
function is handle() and the case statement block is FL_KEYDOWN.  Probably
need to borrow the code from FL_PUSH (single mouse click) and set the
currentpoint property of the axis.  

This is what the callback for a keypress in ginput.m relies on to get the
positioning.


function ginput_keypressfcn (src, evt)
  point = get (gca (), "currentpoint");
  key = evt.Key;
  if (key == "return")
    ## Enter key stops ginput.
    ginput_accumulator (2, NaN, NaN, NaN);
  else
    ginput_accumulator (1, point(1,1), point(1,2), uint8 (key(1)));
  endif
endfunction


Of course, this might not be exactly Matlab compatible as my reading of the
documentation suggests that only a true mouse click should set the
currentpoint property.  But, maybe this small Matlab incompatibity isn't as
bad as not returning X,Y coordinates.

For Qt, the file to change is libgui/graphics/Canvas.cc.  The function is
Canvas::canvasKeyPressEvent.  Very likely the same solution in that
updateCurrentPoint (figObj, obj, event) needs to be called when a key is
pressed, not just for a mouse event.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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