comparison scripts/plot/util/ginput.m @ 27225:57bb8f531707

ginput.m: Make "Enter" key on numeric keypad stop input (bug #56599). * ginput.m (ginput_keypressfcn): Look for the key value "return" (main keyboard) or "enter" on numeric keypad to stop further input.
author Rik <rik@octave.org>
date Tue, 09 Jul 2019 17:50:56 -0700
parents 3aa37c2e22a3
children b442ec6dda5c
comparison
equal deleted inserted replaced
27224:9b8903d3e626 27225:57bb8f531707
144 endfunction 144 endfunction
145 145
146 function ginput_keypressfcn (~, evt) 146 function ginput_keypressfcn (~, evt)
147 147
148 point = get (gca (), "currentpoint"); 148 point = get (gca (), "currentpoint");
149 if (strcmp (evt.Key, "return")) 149 if (strcmp (evt.Key, "return") || strcmp (evt.Key, "enter"))
150 ## Enter key stops ginput. 150 ## <Return> or <Enter> on numeric keypad stops ginput.
151 ginput_accumulator (2, NaN, NaN, NaN); 151 ginput_accumulator (2, NaN, NaN, NaN);
152 else 152 else
153 character = evt.Character; 153 character = evt.Character;
154 if (! isempty (character)) 154 if (! isempty (character))
155 ginput_accumulator (1, point(1,1), point(1,2), uint8 (character(1))); 155 ginput_accumulator (1, point(1,1), point(1,2), uint8 (character(1)));