hey mario-
(using winxp sp2, 2007a, 3.0.8.148604056)
i'm trying to run some code that uses ListenChar()/GetChar() from a
matlab started under "-nodesktop". i try typing into my commandwindow
and neither ListenChar(2) nor GetChar(0) works -- the characters just
appear in the commandwindow and are not detected by the code. in a
matlab started without "-nodesktop", everything is fine.
if i try to execute the test from line 66 of PsychBasic\ListenChar.m
(or line 225 of PsychBasic\GetChar.m), i get:
0
even though:
note that:
2
EXIST('A') returns:
0 if A does not exist
1 if A is a variable in the workspace
2 if A is an M-file on MATLAB's search path. It also returns 2 when
A is the full pathname to a file or when A is the name of an
ordinary file on MATLAB's search path
[...]
thus, the line that follows the builtin test for commandwindow in both
files:
"builtin('commandwindow', msg);"
yields:
??? Cannot find builtin function 'commandwindow'
(this assumes the variable 'msg' was defined, which it is not).
SO. if i disable the tests and just execute "commandwindow," focus
does indeed get sucked to my (nondesktop) commandwindow. but this
does not rescue the "-nodesktop" function.
also note, under "-nodesktop":
» usejava('jvm')
ans =
1
» usejava('awt')
ans =
1
» usejava('swing')
ans =
1
» usejava('desktop')
ans =
0
-erik
(using winxp sp2, 2007a, 3.0.8.148604056)
i'm trying to run some code that uses ListenChar()/GetChar() from a
matlab started under "-nodesktop". i try typing into my commandwindow
and neither ListenChar(2) nor GetChar(0) works -- the characters just
appear in the commandwindow and are not detected by the code. in a
matlab started without "-nodesktop", everything is fine.
if i try to execute the test from line 66 of PsychBasic\ListenChar.m
(or line 225 of PsychBasic\GetChar.m), i get:
>> exist('commandwindow', 'builtin')ans =
0
even though:
>> which commandwindowC:\MATLAB\R2007a\toolbox\matlab\codetools\commandwindow.m
note that:
>> exist('commandwindow')ans =
2
>> help existEXIST Check if variables or functions are defined.
EXIST('A') returns:
0 if A does not exist
1 if A is a variable in the workspace
2 if A is an M-file on MATLAB's search path. It also returns 2 when
A is the full pathname to a file or when A is the name of an
ordinary file on MATLAB's search path
[...]
thus, the line that follows the builtin test for commandwindow in both
files:
"builtin('commandwindow', msg);"
yields:
??? Cannot find builtin function 'commandwindow'
(this assumes the variable 'msg' was defined, which it is not).
SO. if i disable the tests and just execute "commandwindow," focus
does indeed get sucked to my (nondesktop) commandwindow. but this
does not rescue the "-nodesktop" function.
also note, under "-nodesktop":
» usejava('jvm')
ans =
1
» usejava('awt')
ans =
1
» usejava('swing')
ans =
1
» usejava('desktop')
ans =
0
-erik