octave-maintainers
[Top][All Lists]
Advanced

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

Re: Matlab compatibility for keypressfcn


From: Mogrob Sanit
Subject: Re: Matlab compatibility for keypressfcn
Date: Sun, 19 Apr 2015 09:43:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 19/04/2015 00:30, Rik wrote:
4/18/15

Does anyone know if the callback for keypressfcn is executed when a
modifier key is pressed alone?  I'm debugging problems with ginput() and
have found that Octave will execute the callback for any actual key pressed
including the modifiers like SHIFT and CTRL.  This is rather awkward
because generally the modifiers are part of a key sequence like <CTRL+C>
and the there is no key in the data structure for the first part of the
sequence when CTRL is pressed by itself.

Sample code, if necessary, for testing

In file mycb.m:

function mycb ()
   disp ('mycb called');
end

Then,
figure
set (gcf, 'keypressfcn', @mycb)
%% Now try typing just SHIFT or just CTRL in figure window and see if 'mycb
called' is displayed.

Thanks,
Rik


With your code I get (Matlab 7.14)

> Error using mycb
> Too many input arguments.
>
>Error while evaluating figure KeyPressFcn

when pressing CTRL, SHIFT or any other key.

Max



reply via email to

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