Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: java: add keyListener to command window
Date: Thu, 6 Aug 2009 09:01:19 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 12
Message-ID: <h5e64v$ktv$1@fred.mathworks.com>
References: <h5cd5u$pi5$1@fred.mathworks.com> <h5ctj0$dqc$1@fred.mathworks.com> <h5e4r5$99u$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1249549279 21439 172.30.248.38 (6 Aug 2009 09:01:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 6 Aug 2009 09:01:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:561249

>  What do you achieve with 'xCmdWndView = cw.getComponent (0).getViewport.getComponent(0)' ?
> I thougt 'h_cw = mde.getClient('Command Window')' is the handle to command window.

this h_cw reference is only a reference to the container of the Command Window (including the scrollbars etc.), so setting the callbacks on it doesn't work. You need to set it on the actual edittable pane, which is xCmdWndView 

>  How do i reset the callback, with 'set(h_cw,'KeyPressedCallback',' ')'?

Yes

Yair Altman
http://UndocumentedMatlab.com