Mercurial > hg > octave-nkf
changeset 20304:0b83a442ff78
Process SHIFT/CTRL/ALT keys properly for ginput (Bug #44833).
* ginput.m: Return the Character field (the combined keystroke) rather
than the Key field.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 18 Apr 2015 20:38:59 -0700 |
parents | ce027487af26 |
children | c164cfc24bdd |
files | scripts/plot/util/ginput.m |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/util/ginput.m +++ b/scripts/plot/util/ginput.m @@ -130,15 +130,18 @@ function ginput_keypressfcn (src, evt) point = get (gca (), "currentpoint"); - key = evt.Key; - if (key == "return") + if (strcmp (evt.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))); + character = evt.Character; + if (! isempty (character)) + ginput_accumulator (1, point(1,1), point(1,2), uint8 (character(1))); + endif endif endfunction + ## Remove from test statistics. No real tests possible. %!test %! assert (1);