[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get the CurrentKey?
From: |
Prometheus |
Subject: |
Re: How to get the CurrentKey? |
Date: |
Wed, 30 Oct 2019 21:28:42 -0500 (CDT) |
It's me again...
kbhit() is working, but now I have an other problem. If I click on the image
to choose a point, the command window is not selected anymore. I have to
click on the window again. It is annoying.
In Matlab there is "commandwindow" to set the focus on the window again, but
it is not implemented in Octave. Do you have a hint for me?
Here is a example to underline my problem:
clc;
clear all;
printf ("Press 'a' to start\n");
while (1)
%commandwindow %Needed: Set focus on
command window
currentkey = kbhit() %Type 'a' to go on
if currentkey == 'a'
%imshow('MyExample1.jpg') %Will be changed in every
loop
hold on
[xPos, yPos] = ginput(1)
plot(xPos, yPos, 'ro'); %Actual Point
elseif currentkey == 'b' %Type 'b' to stop
return;
else
printf ("Loop is running...\n");
pause(0.2)
endif
endwhile
--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html