[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/
- [Octave-bug-tracker] [bug #44834] [OpenGL] ginput doesn't return proper (X, Y) coordinates for key press, Philip Nienhuis, 2015/04/14
- [Octave-bug-tracker] [bug #44834] [OpenGL] ginput doesn't return proper (X, Y) coordinates for key press,
Rik <=
- [Octave-bug-tracker] [bug #44834] [OpenGL] ginput doesn't return proper (X, Y) coordinates for key press, Philip Nienhuis, 2015/04/14
- [Octave-bug-tracker] [bug #44834] [OpenGL] ginput doesn't return proper (X, Y) coordinates for key press, Rik, 2015/04/18
- [Octave-bug-tracker] [bug #44834] [OpenGL] ginput doesn't return proper (X, Y) coordinates for key press, Guillaume, 2015/04/18
- [Octave-bug-tracker] [bug #44834] [OpenGL] ginput doesn't return proper (X, Y) coordinates for key press, Rik, 2015/04/18
- [Octave-bug-tracker] [bug #44834] [FLTK] ginput doesn't return proper (X, Y) coordinates for key press, Rik, 2015/04/20
- [Octave-bug-tracker] [bug #44834] [FLTK] ginput doesn't return proper (X, Y) coordinates for key press, Philip Nienhuis, 2015/04/21
- [Octave-bug-tracker] [bug #44834] [FLTK] ginput doesn't return proper (X, Y) coordinates for key press, Rik, 2015/04/21
- [Octave-bug-tracker] [bug #44834] [FLTK] ginput doesn't return proper (X, Y) coordinates for key press, Philip Nienhuis, 2015/04/23
- [Octave-bug-tracker] [bug #44834] [FLTK] ginput doesn't return proper (X, Y) coordinates for key press, Philip Nienhuis, 2015/04/23
- [Octave-bug-tracker] [bug #44834] [FLTK] ginput doesn't return proper (X, Y) coordinates for key press, Philip Nienhuis, 2015/04/23