Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!newsfeed.stanford.edu!newsfeed.news.ucla.edu!nrc-news.nrc.ca!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: active change of textbox color?
Date: Sun, 25 Nov 2007 20:01:28 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 17
Message-ID: <fickao$1gh$1@canopus.cc.umanitoba.ca>
References: <fib6nu$560$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1196020888 1553 192.70.172.160 (25 Nov 2007 20:01:28 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Sun, 25 Nov 2007 20:01:28 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:439261


In article <fib6nu$560$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:
>Hello I am trying to achieve the following;

>1. I want the text box to change color only till the period
> I have pressed the respective numeric button. If I release
>the button it should turn "Red" again
>2. If I press two or three buttons simultaneously they
>should change color accordingly.

I believe you will have to work at the Java level to achieve
these goals. Matlab provides a KeyPressFcn callback but not
a KeyReleaseFcn callback. Handling multiple buttons simultaneously
will essentially require working at the keyboard scan code level.
-- 
   "Beware of bugs in the above code; I have only proved it correct,
   not tried it."                                    -- Donald Knuth