Hello again,
I fixed the error by changing line 2383 in spm_input.m
Original:
if (str2num(a.Version) > 7)
Fixed:
if ((str2num(a.Version) > 7) && (str2num(a.Version) < 7.6))
This prevents the focus to go the buttons and keeps it at the
background window, which will monitor keyboard presses. The fix works
also with rounded buttons XP style. Depending on the Matlab version
(mine 7.6) one can change this line accordingly.
Best regards.
Dorian.
2009/2/26 Dorian P <[log in to unmask]>:
> Dear Guillaume,
>
> Unfortunately that didn't resolve the problem. I tried setting Windows
> to classic style and adding the java.opts file.
> SPM turns with a classic look but keyboard shortcuts doesn't work.
>
> It seems Matlab is not focusing on the right place. When I click
> barely out of the buttons then the shortcuts are activated again and I
> can choose "3" with the keyboard. Maybe a small hack in SPM would do
> the trick to turn the focus on the question SPM is doing.
>
> Another thread explaining the problem:
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/235825#630257
>
> Thank you.
> Dorian.
>
> 2009/2/26 Guillaume Flandin <[log in to unmask]>:
>> Dear Dorian,
>>
>>> With the latest one apparently I cannot use keyboard shortcuts during
>>> contrast definition (i.e. pressing "3" to define no statistical
>>> correction, like at the attached image).
>>
>> A change between Matlab releases must impair spm_input.m, but I'm afraid
>> I don't have a fix yet (if anyone has one...)
>>
>>> The gui's also differ with the latest Matlab producing an SPM with
>>> round buttons. Other people in my lab have the same issue but I
>>> couldn't find an answer at the archives.
>>
>> This problem is discussed here:
>> http://www.mathworks.com/matlabcentral/newsreader/view_thread/161302
>>
>> Two solutions, taken from (registered users only)
>> http://www.mathworks.com/support/bugreports/details.html?rp=194025 :
>>
>> * set the screen display to Windows Classic style:
>> 1. Right click on the desktop and select Properties
>> 2. Select the Appearance tab
>> 3. Under Windows and buttons, select Windows Classic style
>>
>> * or, add a java.opts file which contains the statement:
>> -Dswing.noxp=true
>> to your MATLAB startup directory or your $MATLAB\bin\win32 directory,
>> where $MATLAB is the MATLAB root directory on your machine, as returned
>> by typing matlabroot at the MATLAB command prompt.
>>
>> A third solution is for us, SPM developers, to stop having this unusual
>> habit of using disabled buttons as background...
>>
>> All the best,
>> Guillaume.
>>
>> --
>> Guillaume Flandin, PhD
>> Wellcome Trust Centre for Neuroimaging
>> University College London
>> 12 Queen Square
>> London WC1N 3BG
>>
>
|