# Macbook synchronization failure, Kb issues, GetChar issues

**URL:** <https://psychtoolbox.discourse.group/t/macbook-synchronization-failure-kb-issues-getchar-issues/1265>\
**Category:** Uncategorized\
**Created:** [October 3, 2007, 6:42am UTC](https://psychtoolbox.discourse.group/t/macbook-synchronization-failure-kb-issues-getchar-issues/1265 "2007-10-03T06:42:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyleb](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@andyleb](https://psychtoolbox.discourse.group/u/andyleb)\
**Post date:** [October 3, 2007, 6:42am UTC](https://psychtoolbox.discourse.group/t/macbook-synchronization-failure-kb-issues-getchar-issues/1265/1 "2007-10-03T06:42:05Z")

</div>

Hi,  
  
I've been writing some scripts for PTB3 to use across several  
platforms (intel mac using OS X, Win2000, Win XP), and I'm getting up  
to speed fairly well. And I'm thrilled to ditch OS9 finally! But I  
have run into a handful of issues:  
  
1. On my MacBook (regular, not MacBook Pro), the screen test  
routinely fails. I understand the onboard graphics card is pretty  
weak for this computer, but is it bad enough that the PTB Screen   
can't work without skipping the sync test?  
  
2. Kb commands don't accept any input on my Mac when a USB input  
device is connected. That is, when a keyboard or mouse are connected,  
even the laptop's built-in keyboard is not recognized. Note that this  
only applies to Kb commands, as Char commands (e.g., GetChar) still  
works fine. Is this an issue with PsychHID?  
  
3. For windows, I've been having some trouble with the char functions  
(GetChar, ListenChar). I've seen this on 3 separate machines (two  
using XP, one using 2000). Problems that occur are idiosyncratic to  
each machine, though. For instance, on one machine, after calling  
GetChar or ListenChar, the Windows menubar becomes visible on the  
bottom of the screen. On another machine, the Flip command stops  
working normally; that is, when I specify the [dontclear] parameter as  
1, the setting is ignored and the Flip command behaves as if I had  
specified "2" (i.e., the backbuffer simply exchanges with the front  
buffer). To trigger this, I just need to add a Char command anywhere  
before a Flip command.   
  
Any thoughts/comments would be greatly appreciated. And thanks for  
all your work on PTB3!  
  
Andy Leber

---

<div class="post-metadata">

**Author:** ![andyleb](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@andyleb](https://psychtoolbox.discourse.group/u/andyleb)\
**Post date:** [October 17, 2007, 6:53am UTC](https://psychtoolbox.discourse.group/t/macbook-synchronization-failure-kb-issues-getchar-issues/1265/2 "2007-10-17T06:53:14Z")

</div>

Hi Mario (and other PTB readers),  
  
Thanks so much for the previous replies. I'm making progress on the  
other issues, and here's a summary with a few questions/comments.   
  
1. Synchronization failure on Macbook: resolved (I should have used  
some common sense on this one!)  
  
2. Failure of Kb commands on my Macbook when USB keyboard/mouse is  
attached: I thought the problem went away after upgrading MATLAB to  
r2007b, but it worked its way back into my life... As Mario  
recommended, I'll paste below the full output from  
devices=PsychHID('Devices') when the keyboard is attached. Nothing  
seems abnormal from what I can tell (though that doesn't mean much!).  
  
3. Char commands not working on PCs: I'm running XP with r2007b and  
the latest updated version of PTB, as of last week. I just found out,  
though, that Char commands have always had problems with the Java  
virtual machine on Windows, i.e., since PTB2 times. As a Mac user, I  
was totally unaware of this until yesterday when I went to install PTB  
2.54 on a windows machine. I found this on the download page  
([http://psychtoolbox.org/PTB-2/download.html)](http://psychtoolbox.org/PTB-2/download.html)):  
  
"Nojvm" mode is required for GetChar because the Java Virtual Machine  
(JVM) compoenent of MATLAB blocks keyboard input to the Psychtoolbox  
functions GetChar and CharAvail.  
  
Is it the case that -nojvm is still required in PTB3 to use the Char  
commands?  
  
Thanks!   
  
Andy  
  
---------- Output for PsychHID devices -----------------------  
  
Device(1)  
  
 usagePageValue: 12  
 usageValue: 1  
 usageName: 'Consumer Usage 0x1'  
 index: 1  
 transport: 'USB'  
 vendorID: 1452  
 productID: 33344  
 version: 272  
 manufacturer: 'Apple Computer, Inc.'  
 product: 'Apple IR'  
 serialNumber: ''  
 locationID: 1.5624e+09  
 totalElements: 21  
 features: 0  
 inputs: 20  
 outputs: 0  
 collections: 1  
 axes: 0  
 buttons: 0  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 0  
  
Device(2)  
  
 usagePageValue: 1  
 usageValue: 128  
 usageName: 'System Control'  
 index: 2  
 transport: 'USB'  
 vendorID: 2689  
 productID: 257  
 version: 272  
 manufacturer: 'CHESEN'  
 product: 'USB Keyboard'  
 serialNumber: ''  
 locationID: 1.0245e+09  
 totalElements: 29  
 features: 0  
 inputs: 27  
 outputs: 0  
 collections: 2  
 axes: 0  
 buttons: 0  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 0  
  
Device(3)  
  
 usagePageValue: 1  
 usageValue: 6  
 usageName: 'Keyboard'  
 index: 3  
 transport: 'USB'  
 vendorID: 2689  
 productID: 257  
 version: 272  
 manufacturer: 'CHESEN'  
 product: 'USB Keyboard'  
 serialNumber: ''  
 locationID: 1.0245e+09  
 totalElements: 276  
 features: 0  
 inputs: 270  
 outputs: 5  
 collections: 1  
 axes: 0  
 buttons: 0  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 0  
  
  
Device(4)  
  
 usagePageValue: 12  
 usageValue: 1  
 usageName: 'Consumer Usage 0x1'  
 index: 4  
 transport: 'USB'  
 vendorID: 1452  
 productID: 538  
 version: 19  
 manufacturer: 'Apple Computer'  
 product: 'Apple Internal Keyboard / Trackpad'  
 serialNumber: ''  
 locationID: 488636416  
 totalElements: 2  
 features: 0  
 inputs: 1  
 outputs: 0  
 collections: 1  
 axes: 0  
 buttons: 0  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 0  
  
  
Device(5)  
  
 usagePageValue: 1  
 usageValue: 2  
 usageName: 'Mouse'  
 index: 5  
 transport: 'USB'  
 vendorID: 1452  
 productID: 538  
 version: 0  
 manufacturer: 'Apple Computer'  
 product: 'Apple Internal Keyboard / Trackpad'  
 serialNumber: '0'  
 locationID: 488636416  
 totalElements: 6  
 features: 0  
 inputs: 4  
 outputs: 0  
 collections: 2  
 axes: 2  
 buttons: 1  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 1  
  
Device(6)  
  
 usagePageValue: 255  
 usageValue: 1  
 usageName: 'Page: 0xff, Usage: 0x1'  
 index: 6  
 transport: 'USB'  
 vendorID: 1452  
 productID: 538  
 version: 0  
 manufacturer: 'Apple'  
 product: 'Trackpad'  
 serialNumber: ''  
 locationID: 488636416  
 totalElements: 20  
 features: 17  
 inputs: 2  
 outputs: 0  
 collections: 1  
 axes: 0  
 buttons: 0  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 0  
  
Device(7)  
  
 usagePageValue: 1  
 usageValue: 2  
 usageName: 'Mouse'  
 index: 7  
 transport: 'USB'  
 vendorID: 1452  
 productID: 538  
 version: 0  
 manufacturer: 'Apple'  
 product: 'Trackpad'  
 serialNumber: ''  
 locationID: 488636416  
 totalElements: 27  
 features: 17  
 inputs: 7  
 outputs: 0  
 collections: 3  
 axes: 2  
 buttons: 3  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 0  
  
Device(8)  
  
 usagePageValue: 1  
 usageValue: 6  
 usageName: 'Keyboard'  
 index: 8  
 transport: 'USB'  
 vendorID: 1452  
 productID: 538  
 version: 19  
 manufacturer: 'Apple Computer'  
 product: 'Apple Internal Keyboard / Trackpad'  
 serialNumber: ''  
 locationID: 488636416  
 totalElements: 244  
 features: 0  
 inputs: 238  
 outputs: 5  
 collections: 1  
 axes: 0  
 buttons: 0  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 0  
  
--------------- end output -----------------------------------  
  
  
  
--- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
\<mario.kleiner@...\> wrote:  

> \>  
> \> Reg. Sync failures: If you open your window by providing a  
> \> rect parameter of e.g., [0 0 640 480], so it only covers part  
> \> of the screen, yes, you may get more sync failures and a  
> \> generally unusable timing for real work. This mode is ok  
> \> for debugging your script etc., but not for timing tests or  
> \> real data collection. The OS/X Quartz window manager  
> \> interferes with presentation timing and timestamping in  
> \> windowed mode, and probably even more so on a weak  
> \> GMA-950. But even with high-end graphics you wouldn't  
> \> get good enough timing. Just use the 'SkipSyncTests' setting  
> \> during development/debugging of your script and remove  
> \> it for real data collection.  
> \>   
> \> -mario  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "andyleb" \<andyleb@\> wrote:  
> \> \>  
> \> \> Hi Mario,  
> \> \>   
> \> \> Thanks so much for replying. At the time I posted, I was running  
> \> \> PTB3's \*very\* latest beta, with matlab2006a (7.4). Since then, I've  
> \> \> upgraded to matlab2006b (7.5) and reinstalled PTB3-beta. I also  
> \> \> updated to the most recent version of quicktime.  
> \> \>   
> \> \> 1. Sync failures. I realized that it's much more likely to occur  
> \> \> when my main window is smaller than the full size of my display (e.g.,  
> \> \> 640x480 in a 1280x800 screen). Did I wrongly assume we can open small  
> \> \> windows in OS X without syncing trouble? The output is pasted into  
> \> \> this message (please scroll down).  
> \> \>   
> \> \> 2. USB device trouble. Since upgrading, I haven't had this problem  
> \> \> at all. Maybe I just had a buggy install of matlab 2006a?  
> \> \>   
> \> \> 3. I'm still looking into the Char problems on the various windows  
> \> \> machines, based on your recommendations. I'll post on those  
> \> \> separately. I'd also like to hear if anyone else has experienced  
> \> \> these problems.  
> \> \>   
> \> \> Thanks so much for your help!!  
> \> \>   
> \> \> Andy  
> \> \>   
> \> \>   
> \> \>   
> \> \> -------- SYNC FAILURE OUTPUT --------------------------------------  
> \> \>   
> \> \> PTB-INFO: This is the OpenGL-Psychtoolbox version 3.0.8. Type  
> \> \> 'PsychtoolboxVersion' for more detailed version information.  
> \> \> PTB-INFO: Psychtoolbox is licensed to you under terms of the GNU  
> \> \> General Public License (GPL). See file 'License.txt' in the  
> \> \> PTB-INFO: Psychtoolbox root folder for a copy of the GPL license.  
> \> \>   
> \> \>   
> \> \>   
> \> \> OpenGL-Extensions are: GL\_ARB\_transpose\_matrix GL\_ARB\_vertex\_program  
> \> \> GL\_ARB\_vertex\_blend GL\_ARB\_window\_pos GL\_ARB\_shader\_objects  
> \> \> GL\_ARB\_vertex\_shader GL\_EXT\_multi\_draw\_arrays GL\_EXT\_clip\_volume\_hint  
> \> \> GL\_EXT\_rescale\_normal GL\_EXT\_draw\_range\_elements GL\_EXT\_fog\_coord  
> \> \> GL\_EXT\_gpu\_program\_parameters GL\_APPLE\_client\_storage  
> \> \> GL\_APPLE\_specular\_vector GL\_APPLE\_transform\_hint  
> \> \> GL\_APPLE\_packed\_pixels GL\_APPLE\_fence GL\_APPLE\_vertex\_array\_object  
> \> \> GL\_APPLE\_vertex\_program\_evaluators GL\_APPLE\_element\_array  
> \> \> GL\_APPLE\_flush\_render GL\_NV\_texgen\_reflection GL\_NV\_light\_max\_exponent  
> \> \> GL\_IBM\_rasterpos\_clip GL\_SGIS\_generate\_mipmap  
> \> \> GL\_ARB\_shading\_language\_100 GL\_ARB\_texture\_border\_clamp  
> \> \> GL\_ARB\_multitexture GL\_ARB\_texture\_env\_add GL\_ARB\_texture\_cube\_map  
> \> \> GL\_ARB\_texture\_env\_dot3 GL\_ARB\_texture\_env\_combine  
> \> \> GL\_ARB\_texture\_compression GL\_ARB\_texture\_mirrored\_repeat  
> \> \> GL\_ARB\_shadow GL\_ARB\_depth\_texture GL\_ARB\_fragment\_program  
> \> \> GL\_ARB\_fragment\_shader GL\_ARB\_point\_sprite  
> \> \> GL\_ARB\_texture\_non\_power\_of\_two GL\_ARB\_vertex\_buffer\_object  
> \> \> GL\_ARB\_pixel\_buffer\_object GL\_EXT\_framebuffer\_object  
> \> \> GL\_EXT\_texture\_rectangle GL\_ARB\_texture\_rectangle  
> \> \> GL\_EXT\_texture\_env\_add GL\_EXT\_blend\_color GL\_EXT\_blend\_minmax  
> \> \> GL\_EXT\_blend\_subtract GL\_EXT\_texture\_lod\_bias GL\_EXT\_abgr GL\_EXT\_bgra  
> \> \> GL\_EXT\_stencil\_wrap GL\_EXT\_texture\_filter\_anisotropic  
> \> \> GL\_EXT\_separate\_specular\_color GL\_EXT\_secondary\_color  
> \> \> GL\_EXT\_blend\_func\_separate GL\_EXT\_shadow\_funcs GL\_EXT\_stencil\_two\_side  
> \> \> GL\_EXT\_texture\_compression\_s3tc GL\_EXT\_texture\_compression\_dxt1  
> \> \> GL\_EXT\_blend\_equation\_separate GL\_EXT\_packed\_depth\_stencil  
> \> \> GL\_APPLE\_flush\_buffer\_range GL\_APPLE\_ycbcr\_422 GL\_APPLE\_texture\_range  
> \> \> GL\_APPLE\_pixel\_buffer GL\_NV\_blend\_square GL\_ATI\_texture\_env\_combine3  
> \> \> GL\_SGIS\_texture\_edge\_clamp GL\_SGIS\_texture\_lod   
> \> \>   
> \> \>   
> \> \>   
> \> \> PTB-INFO: OpenGL-Renderer is Intel Inc. :: Intel GMA 950 OpenGL Engine  
> \> \> :: 1.2 APPLE-1.4.56  
> \> \> PTB-INFO: Renderer has 64 MB of VRAM and a maximum 64 MB of texture  
> \> \> memory.  
> \> \> PTB-Info: VBL startline = 800 , VBL Endline = -1  
> \> \> PTB-Info: Beamposition queries unsupported on this system. Will try to  
> \> \> use kernel-level vbl interrupts as fallback.  
> \> \> PTB-Info: Measured monitor refresh interval from VBLsync = 17.356896  
> \> \> ms [57.613989 Hz]. (57 valid samples taken, stddev=3.102240 ms.)  
> \> \> PTB-Info: Small deviations between reported values are normal and no  
> \> \> reason to worry.  
> \> \> PTB-INFO: Using OpenGL GL\_TEXTURE\_RECTANGLE\_EXT extension for  
> \> \> efficient high-performance texture mapping...  
> \> \>   
> \> \> WARNING: Couldn't compute a reliable estimate of monitor refresh  
> \> \> interval! Trouble with VBL syncing?!?  
> \> \>   
> \> \>   
> \> \> ----- ! PTB - ERROR: SYNCHRONIZATION FAILURE ! ----  
> \> \>   
> \> \> One or more internal checks (see Warnings above) indicate that  
> \> \> synchronization  
> \> \> of Psychtoolbox to the vertical retrace (VBL) is not working on your  
> \> \> setup.  
> \> \>   
> \> \> This will seriously impair proper stimulus presentation and stimulus  
> \> \> presentation timing!  
> \> \> Please read 'help SyncTrouble' for information about how to solve or  
> \> \> work-around the problem.  
> \> \> You can force Psychtoolbox to continue, despite the severe problems,  
> \> \> by adding the command  
> \> \> Screen('Preference', 'SkipSyncTests',1); at the top of your script, if  
> \> \> you really know what you are doing.  
> \> \>   
> \> \>   
> \> \> -------- END OUTPUT --------------------------------------  
> \> \>   
> \> \>   
> \> \>   
> \> \>   
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \<mario.kleiner@\> wrote:  
> \> \> \>  
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "andyleb" \<andyleb@\> wrote:  
> \> \> \>   
> \> \> \> \> 1. On my MacBook (regular, not MacBook Pro), the screen test  
> \> \> \> \> routinely fails. I understand the onboard graphics card is pretty  
> \> \> \> \> weak for this computer, but is it bad enough that the PTB Screen   
> \> \> \> \> can't work without skipping the sync test?  
> \> \> \>   
> \> \> \> Strange, worked on MacBook/IntelGMA when i tested it last time.  
> \> \> \> Provide PTB's Matlab output of the failure. I assume you run the  
> \> \> \> \*very latest\* 'beta'?  
> \> \> \>   
> \> \> \> You can always either completely skip the test or tell PTB to go  
> \> \> \> on in case of failure, you'll just lose our normally super-exact  
> \> \> \> timing if you do so -- or something else screws up if there was  
> \> \> \> a good severe reason for the sync-failure of course and not  
> \> \> \> only a noisy system.  
> \> \> \>   
> \> \> \> See: \<[http://psychtoolbox.org/wikka.php?wakka=FaqWarningPrefs](http://psychtoolbox.org/wikka.php?wakka=FaqWarningPrefs)\>  
> \> \> \>   
> \> \> \> or simply the help texts that PTB outputs in case of failure. I

assume  

> \> \> \> you read them?  
> \> \> \>   
> \> \> \> \>   
> \> \> \> \> 2. Kb commands don't accept any input on my Mac when a USB input  
> \> \> \> \> device is connected. That is, when a keyboard or mouse are

connected,  

> \> \> \> \> even the laptop's built-in keyboard is not recognized. Note

that this  

> \> \> \> \> only applies to Kb commands, as Char commands (e.g., GetChar)

still  

> \> \> \> \> works fine. Is this an issue with PsychHID?  
> \> \> \>   
> \> \> \> Also strange. I work all the time with a USB mouse connected and  
> \> \> \> we never heard of or experienced an issue like that.  
> \> \> \>   
> \> \> \> What is the output of "GetKeyboardIndices" in that case? What does  
> \> \> \> d=PsychHID('GetDevices') report? I mean of course the full content  
> \> \> \> of 'd' d(1), d(2), ....  
> \> \> \>   
> \> \> \> \>   
> \> \> \> \> 3. For windows, I've been having some trouble with the char

functions  

> \> \> \> \> (GetChar, ListenChar). I've seen this on 3 separate machines (two  
> \> \> \> \> using XP, one using 2000). Problems that occur are

idiosyncratic to  

> \> \> \> \> each machine, though. For instance, on one machine, after calling  
> \> \> \> \> GetChar or ListenChar, the Windows menubar becomes visible on the  
> \> \> \> \> bottom of the screen. On another machine, the Flip command stops  
> \> \> \> \> working normally; that is, when I specify the [dontclear]

parameter as  

> \> \> \> \> 1, the setting is ignored and the Flip command behaves as if I had  
> \> \> \> \> specified "2" (i.e., the backbuffer simply exchanges with the

front  

> \> \> \> \> buffer). To trigger this, I just need to add a Char command

anywhere  

> \> \> \> \> before a Flip command.   
> \> \> \>   
> \> \> \> Anybody else ever seen this? Which Matlab version is this? What  
> \> \> \> graphics card? Up to date drivers installed?  
> \> \> \>   
> \> \> \> There is no direct connection between 'Flip' and GetChar etc. but  
> \> \> \> you never know how Java's GetChar handling interacts with Matlabs  
> \> \> \> desktop UI and that with desktop manager gimmicks of the  
> \> \> \> graphics driver -- Windows is a mess.  
> \> \> \>   
> \> \> \> But the 'dontclear' setting 1 doesn't work on many Windows graphics  
> \> \> \> cards due to lack of features in the graphics drivers. If you have  
> \> \> \> recent graphics hardware and need that feature, then its  
> \> \> \> a good idea to enable the imaging pipeline by setting the  
> \> \> \> optional 'imagingMode' flag of Screen('OpenWindow', ...) to  
> \> \> \> kPsychNeedFastBackingStore.  
> \> \> \>   
> \> \> \> best,  
> \> \> \> -mario  
> \> \> \>  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [October 31, 2007, 10:17pm UTC](https://psychtoolbox.discourse.group/t/macbook-synchronization-failure-kb-issues-getchar-issues/1265/3 "2007-10-31T22:17:02Z")

</div>

Hi Mario -   
  
I am having the same problem as Andy, and after going through all of the suggested fixes   
in this thread, am having no luck. I'm on an Intel Mac Tower running 10.4.10, and Matlab   
7.5 (2007b), and have the same trouble with 7.4. I've restarted the machine & Matlab   
many times, reinstalled toobox, and have switched keyboards and usb slots. Control-C   
works fine but I can't get KbCheck to register any other keys.   
  
The same code/debugging reveals no problems at all on a macmini in my lab - everything   
works great there yet it's the same OS & Matlab version. Is there something different   
about my Tower's hardware? I've pasted a sample debug session below, and any help   
would be greatly appreciated!   
  
-Steve  
PS: after asking some friends using toolbox, some report a similar problem but for a   
restart clears it for them.   
  
  

> \>\> KbDemo

1 of 4. Testing KbCheck and KbName: press a key to see its number.  
Press the escape key to proceed to the next demo.  
d  
s  
sdlkdk  
[pressed control-c]   
??? Operation terminated by user during ==\> KbCheck at 108  
  
In ==\> KbDemo\>KbDemoPart1 at 100  
 [keyIsDown, seconds, keyCode] = KbCheck;  
  
In ==\> KbDemo at 74  
KbDemoPart1;  
  

> \>\> WaitSecs(.2); KbWait

d  
d  
d  
d  
  
[pressed control-c]   
??? Operation terminated by user during ==\> KbWait at 58  
  
  

> \>\> d=PsychHID('Devices')

d =   
  
1x2 struct array with fields:  
 usagePageValue  
 usageValue  
 usageName  
 index  
 transport  
 vendorID  
 productID  
 version  
 manufacturer  
 product  
 serialNumber  
 locationID  
 totalElements  
 features  
 inputs  
 outputs  
 collections  
 axes  
 buttons  
 hats  
 sliders  
 dials  
 wheels  
  

> \>\> d(1)

ans =   
  
 usagePageValue: 1  
 usageValue: 2  
 usageName: 'Mouse'  
 index: 1  
 transport: 'USB'  
 vendorID: 1452  
 productID: 772  
 version: 272  
 manufacturer: 'Mitsumi Electric'  
 product: 'Apple Optical USB Mouse'  
 serialNumber: ''  
 locationID: 488767488  
 totalElements: 11  
 features: 0  
 inputs: 9  
 outputs: 0  
 collections: 2  
 axes: 3  
 buttons: 4  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 1  
  

> \>\> d(2)

ans =   
  
 usagePageValue: 1  
 usageValue: 6  
 usageName: 'Keyboard'  
 index: 2  
 transport: 'USB'  
 vendorID: 1452  
 productID: 513  
 version: 257  
 manufacturer: 'Alps Electric'  
 product: 'M2452'  
 serialNumber: ''  
 locationID: 488701952  
 totalElements: 274  
 features: 0  
 inputs: 270  
 outputs: 3  
 collections: 1  
 axes: 0  
 buttons: 0  
 hats: 0  
 sliders: 0  
 dials: 0  
 wheels: 0  
  

> \>\> GetKeyboardIndices

ans =  
  
 2  
  

> \>\> KbCheck(2)

ans =  
  
 0  
  
Finally, if I put the above KbCheck(2) into a hand-coded KbWait, it never registers   
anything.   
  
  
  
  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner" \<mario.kleiner@...\> wrote:  
> \>  
> \> \> 2. Failure of Kb commands on my Macbook when USB keyboard/mouse is  
> \> \> attached: I thought the problem went away after upgrading MATLAB to  
> \> \> r2007b, but it worked its way back into my life... As Mario  
> \> \> recommended, I'll paste below the full output from  
> \> \> devices=PsychHID('Devices') when the keyboard is attached. Nothing  
> \> \> seems abnormal from what I can tell (though that doesn't mean much!).  
> \>   
> \> What is the output of GetKeyboardIndices? If that lists the id's of your  
> \> two keyboards (built-in and external) and KbCheck doesn't throw  
> \> any errors when you use it, then the keyboards should get detected.  
> \>   
> \> If you pass the index to KbCheck, e.g.,  
> \>   
> \> KbCheck(3) for your USB kb or KbCheck(8) for your internal keyboard,  
> \> then at least query of the internal keyboard should work. By default  
> \> KbCheck will query the first keyboard (lowest index) it finds in your  
> \> system if you don't ask for a specific one - in this case the external  
> \> USB one, because 3 \< 8.  
> \>   
> \> Did you try all keys of the keyboard to see if some of them  
> \> get detected? Are there any special keys or switches on your kb?  
> \>   
> \> KbCheck only queries the keys with usb scancodes between 1 and  
> \> 255. It's a bit suspicious to me that your USB kb seems to have  
> \> more than 255 keys.  
> \>   
> \> Did you try with different USB keyboards?  
> \>   
> \> \>   
> \> \> 3. Char commands not working on PCs: I'm running XP with r2007b and  
> \> \> the latest updated version of PTB, as of last week. I just found out,  
> \> \> though, that Char commands have always had problems with the Java  
> \> \> virtual machine on Windows, i.e., since PTB2 times. As a Mac user, I  
> \> \> was totally unaware of this until yesterday when I went to install PTB  
> \> \> 2.54 on a windows machine. I found this on the download page  
> \> \> ([http://psychtoolbox.org/PTB-2/download.html)](http://psychtoolbox.org/PTB-2/download.html)):  
> \>   
> \> For Matlab R2007a and R2007b its the opposite, it wouldn't work with  
> \> -nojvm mode at the moment, because that .dll's are not yet ported  
> \> over. The Java based GetChar should work -- at least it does on  
> \> my R2007a + XP setup.  
> \>   
> \> I don't have 2007b on Windows, but you never know what  
> \> kind of new GetChar trouble Mathworks likes to introduce with  
> \> each new Matlab release. In general, GetChar is the most fragile  
> \> part of PTB, because it has to rely on Matlabs Java implementation,  
> \> which is in my experience the most prominent reason for Matlab  
> \> crashes/out of memory conditions/all kind of other trouble.  
> \> Matlabs interaction with the event queue is a complete black box  
> \> for us, not much we can do about that -- except finding new  
> \> weird workarounds for the weird trouble introduced with new  
> \> releases of Matlab. --\> Avoid GetChar if you can.  
> \>   
> \> -mario  
> \>   
> \> \>   
> \> \> "Nojvm" mode is required for GetChar because the Java Virtual Machine  
> \> \> (JVM) compoenent of MATLAB blocks keyboard input to the Psychtoolbox  
> \> \> functions GetChar and CharAvail.  
> \> \>   
> \> \> Is it the case that -nojvm is still required in PTB3 to use the Char  
> \> \> commands?  
> \> \>   
> \> \> Thanks!   
> \> \>   
> \> \> Andy  
> \> \>   
> \> \> ---------- Output for PsychHID devices -----------------------  
> \> \>   
> \> \> Device(1)  
> \> \>   
> \> \> usagePageValue: 12  
> \> \> usageValue: 1  
> \> \> usageName: 'Consumer Usage 0x1'  
> \> \> index: 1  
> \> \> transport: 'USB'  
> \> \> vendorID: 1452  
> \> \> productID: 33344  
> \> \> version: 272  
> \> \> manufacturer: 'Apple Computer, Inc.'  
> \> \> product: 'Apple IR'  
> \> \> serialNumber: ''  
> \> \> locationID: 1.5624e+09  
> \> \> totalElements: 21  
> \> \> features: 0  
> \> \> inputs: 20  
> \> \> outputs: 0  
> \> \> collections: 1  
> \> \> axes: 0  
> \> \> buttons: 0  
> \> \> hats: 0  
> \> \> sliders: 0  
> \> \> dials: 0  
> \> \> wheels: 0  
> \> \>   
> \> \> Device(2)  
> \> \>   
> \> \> usagePageValue: 1  
> \> \> usageValue: 128  
> \> \> usageName: 'System Control'  
> \> \> index: 2  
> \> \> transport: 'USB'  
> \> \> vendorID: 2689  
> \> \> productID: 257  
> \> \> version: 272  
> \> \> manufacturer: 'CHESEN'  
> \> \> product: 'USB Keyboard'  
> \> \> serialNumber: ''  
> \> \> locationID: 1.0245e+09  
> \> \> totalElements: 29  
> \> \> features: 0  
> \> \> inputs: 27  
> \> \> outputs: 0  
> \> \> collections: 2  
> \> \> axes: 0  
> \> \> buttons: 0  
> \> \> hats: 0  
> \> \> sliders: 0  
> \> \> dials: 0  
> \> \> wheels: 0  
> \> \>   
> \> \> Device(3)  
> \> \>   
> \> \> usagePageValue: 1  
> \> \> usageValue: 6  
> \> \> usageName: 'Keyboard'  
> \> \> index: 3  
> \> \> transport: 'USB'  
> \> \> vendorID: 2689  
> \> \> productID: 257  
> \> \> version: 272  
> \> \> manufacturer: 'CHESEN'  
> \> \> product: 'USB Keyboard'  
> \> \> serialNumber: ''  
> \> \> locationID: 1.0245e+09  
> \> \> totalElements: 276  
> \> \> features: 0  
> \> \> inputs: 270  
> \> \> outputs: 5  
> \> \> collections: 1  
> \> \> axes: 0  
> \> \> buttons: 0  
> \> \> hats: 0  
> \> \> sliders: 0  
> \> \> dials: 0  
> \> \> wheels: 0  
> \> \>   
> \> \>   
> \> \> Device(4)  
> \> \>   
> \> \> usagePageValue: 12  
> \> \> usageValue: 1  
> \> \> usageName: 'Consumer Usage 0x1'  
> \> \> index: 4  
> \> \> transport: 'USB'  
> \> \> vendorID: 1452  
> \> \> productID: 538  
> \> \> version: 19  
> \> \> manufacturer: 'Apple Computer'  
> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> serialNumber: ''  
> \> \> locationID: 488636416  
> \> \> totalElements: 2  
> \> \> features: 0  
> \> \> inputs: 1  
> \> \> outputs: 0  
> \> \> collections: 1  
> \> \> axes: 0  
> \> \> buttons: 0  
> \> \> hats: 0  
> \> \> sliders: 0  
> \> \> dials: 0  
> \> \> wheels: 0  
> \> \>   
> \> \>   
> \> \> Device(5)  
> \> \>   
> \> \> usagePageValue: 1  
> \> \> usageValue: 2  
> \> \> usageName: 'Mouse'  
> \> \> index: 5  
> \> \> transport: 'USB'  
> \> \> vendorID: 1452  
> \> \> productID: 538  
> \> \> version: 0  
> \> \> manufacturer: 'Apple Computer'  
> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> serialNumber: '0'  
> \> \> locationID: 488636416  
> \> \> totalElements: 6  
> \> \> features: 0  
> \> \> inputs: 4  
> \> \> outputs: 0  
> \> \> collections: 2  
> \> \> axes: 2  
> \> \> buttons: 1  
> \> \> hats: 0  
> \> \> sliders: 0  
> \> \> dials: 0  
> \> \> wheels: 1  
> \> \>   
> \> \> Device(6)  
> \> \>   
> \> \> usagePageValue: 255  
> \> \> usageValue: 1  
> \> \> usageName: 'Page: 0xff, Usage: 0x1'  
> \> \> index: 6  
> \> \> transport: 'USB'  
> \> \> vendorID: 1452  
> \> \> productID: 538  
> \> \> version: 0  
> \> \> manufacturer: 'Apple'  
> \> \> product: 'Trackpad'  
> \> \> serialNumber: ''  
> \> \> locationID: 488636416  
> \> \> totalElements: 20  
> \> \> features: 17  
> \> \> inputs: 2  
> \> \> outputs: 0  
> \> \> collections: 1  
> \> \> axes: 0  
> \> \> buttons: 0  
> \> \> hats: 0  
> \> \> sliders: 0  
> \> \> dials: 0  
> \> \> wheels: 0  
> \> \>   
> \> \> Device(7)  
> \> \>   
> \> \> usagePageValue: 1  
> \> \> usageValue: 2  
> \> \> usageName: 'Mouse'  
> \> \> index: 7  
> \> \> transport: 'USB'  
> \> \> vendorID: 1452  
> \> \> productID: 538  
> \> \> version: 0  
> \> \> manufacturer: 'Apple'  
> \> \> product: 'Trackpad'  
> \> \> serialNumber: ''  
> \> \> locationID: 488636416  
> \> \> totalElements: 27  
> \> \> features: 17  
> \> \> inputs: 7  
> \> \> outputs: 0  
> \> \> collections: 3  
> \> \> axes: 2  
> \> \> buttons: 3  
> \> \> hats: 0  
> \> \> sliders: 0  
> \> \> dials: 0  
> \> \> wheels: 0  
> \> \>   
> \> \> Device(8)  
> \> \>   
> \> \> usagePageValue: 1  
> \> \> usageValue: 6  
> \> \> usageName: 'Keyboard'  
> \> \> index: 8  
> \> \> transport: 'USB'  
> \> \> vendorID: 1452  
> \> \> productID: 538  
> \> \> version: 19  
> \> \> manufacturer: 'Apple Computer'  
> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> serialNumber: ''  
> \> \> locationID: 488636416  
> \> \> totalElements: 244  
> \> \> features: 0  
> \> \> inputs: 238  
> \> \> outputs: 5  
> \> \> collections: 1  
> \> \> axes: 0  
> \> \> buttons: 0  
> \> \> hats: 0  
> \> \> sliders: 0  
> \> \> dials: 0  
> \> \> wheels: 0  
> \> \>   
> \> \> --------------- end output -----------------------------------  
> \> \>   
> \> \>   
> \> \>   
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \<mario.kleiner@\> wrote:  
> \> \> \>  
> \> \> \> Reg. Sync failures: If you open your window by providing a  
> \> \> \> rect parameter of e.g., [0 0 640 480], so it only covers part  
> \> \> \> of the screen, yes, you may get more sync failures and a  
> \> \> \> generally unusable timing for real work. This mode is ok  
> \> \> \> for debugging your script etc., but not for timing tests or  
> \> \> \> real data collection. The OS/X Quartz window manager  
> \> \> \> interferes with presentation timing and timestamping in  
> \> \> \> windowed mode, and probably even more so on a weak  
> \> \> \> GMA-950. But even with high-end graphics you wouldn't  
> \> \> \> get good enough timing. Just use the 'SkipSyncTests' setting  
> \> \> \> during development/debugging of your script and remove  
> \> \> \> it for real data collection.  
> \> \> \>   
> \> \> \> -mario  
> \> \> \>   
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "andyleb" \<andyleb@\> wrote:  
> \> \> \> \>  
> \> \> \> \> Hi Mario,  
> \> \> \> \>   
> \> \> \> \> Thanks so much for replying. At the time I posted, I was running  
> \> \> \> \> PTB3's \*very\* latest beta, with matlab2006a (7.4). Since then, I've  
> \> \> \> \> upgraded to matlab2006b (7.5) and reinstalled PTB3-beta. I also  
> \> \> \> \> updated to the most recent version of quicktime.  
> \> \> \> \>   
> \> \> \> \> 1. Sync failures. I realized that it's much more likely to occur  
> \> \> \> \> when my main window is smaller than the full size of my display (e.g.,  
> \> \> \> \> 640x480 in a 1280x800 screen). Did I wrongly assume we can open small  
> \> \> \> \> windows in OS X without syncing trouble? The output is pasted into  
> \> \> \> \> this message (please scroll down).  
> \> \> \> \>   
> \> \> \> \> 2. USB device trouble. Since upgrading, I haven't had this problem  
> \> \> \> \> at all. Maybe I just had a buggy install of matlab 2006a?  
> \> \> \> \>   
> \> \> \> \> 3. I'm still looking into the Char problems on the various windows  
> \> \> \> \> machines, based on your recommendations. I'll post on those  
> \> \> \> \> separately. I'd also like to hear if anyone else has experienced  
> \> \> \> \> these problems.  
> \> \> \> \>   
> \> \> \> \> Thanks so much for your help!!  
> \> \> \> \>   
> \> \> \> \> Andy  
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> -------- SYNC FAILURE OUTPUT --------------------------------------  
> \> \> \> \>   
> \> \> \> \> PTB-INFO: This is the OpenGL-Psychtoolbox version 3.0.8. Type  
> \> \> \> \> 'PsychtoolboxVersion' for more detailed version information.  
> \> \> \> \> PTB-INFO: Psychtoolbox is licensed to you under terms of the GNU  
> \> \> \> \> General Public License (GPL). See file 'License.txt' in the  
> \> \> \> \> PTB-INFO: Psychtoolbox root folder for a copy of the GPL license.  
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> OpenGL-Extensions are: GL\_ARB\_transpose\_matrix GL\_ARB\_vertex\_program  
> \> \> \> \> GL\_ARB\_vertex\_blend GL\_ARB\_window\_pos GL\_ARB\_shader\_objects  
> \> \> \> \> GL\_ARB\_vertex\_shader GL\_EXT\_multi\_draw\_arrays GL\_EXT\_clip\_volume\_hint  
> \> \> \> \> GL\_EXT\_rescale\_normal GL\_EXT\_draw\_range\_elements GL\_EXT\_fog\_coord  
> \> \> \> \> GL\_EXT\_gpu\_program\_parameters GL\_APPLE\_client\_storage  
> \> \> \> \> GL\_APPLE\_specular\_vector GL\_APPLE\_transform\_hint  
> \> \> \> \> GL\_APPLE\_packed\_pixels GL\_APPLE\_fence GL\_APPLE\_vertex\_array\_object  
> \> \> \> \> GL\_APPLE\_vertex\_program\_evaluators GL\_APPLE\_element\_array  
> \> \> \> \> GL\_APPLE\_flush\_render GL\_NV\_texgen\_reflection GL\_NV\_light\_max\_exponent  
> \> \> \> \> GL\_IBM\_rasterpos\_clip GL\_SGIS\_generate\_mipmap  
> \> \> \> \> GL\_ARB\_shading\_language\_100 GL\_ARB\_texture\_border\_clamp  
> \> \> \> \> GL\_ARB\_multitexture GL\_ARB\_texture\_env\_add GL\_ARB\_texture\_cube\_map  
> \> \> \> \> GL\_ARB\_texture\_env\_dot3 GL\_ARB\_texture\_env\_combine  
> \> \> \> \> GL\_ARB\_texture\_compression GL\_ARB\_texture\_mirrored\_repeat  
> \> \> \> \> GL\_ARB\_shadow GL\_ARB\_depth\_texture GL\_ARB\_fragment\_program  
> \> \> \> \> GL\_ARB\_fragment\_shader GL\_ARB\_point\_sprite  
> \> \> \> \> GL\_ARB\_texture\_non\_power\_of\_two GL\_ARB\_vertex\_buffer\_object  
> \> \> \> \> GL\_ARB\_pixel\_buffer\_object GL\_EXT\_framebuffer\_object  
> \> \> \> \> GL\_EXT\_texture\_rectangle GL\_ARB\_texture\_rectangle  
> \> \> \> \> GL\_EXT\_texture\_env\_add GL\_EXT\_blend\_color GL\_EXT\_blend\_minmax  
> \> \> \> \> GL\_EXT\_blend\_subtract GL\_EXT\_texture\_lod\_bias GL\_EXT\_abgr GL\_EXT\_bgra  
> \> \> \> \> GL\_EXT\_stencil\_wrap GL\_EXT\_texture\_filter\_anisotropic  
> \> \> \> \> GL\_EXT\_separate\_specular\_color GL\_EXT\_secondary\_color  
> \> \> \> \> GL\_EXT\_blend\_func\_separate GL\_EXT\_shadow\_funcs GL\_EXT\_stencil\_two\_side  
> \> \> \> \> GL\_EXT\_texture\_compression\_s3tc GL\_EXT\_texture\_compression\_dxt1  
> \> \> \> \> GL\_EXT\_blend\_equation\_separate GL\_EXT\_packed\_depth\_stencil  
> \> \> \> \> GL\_APPLE\_flush\_buffer\_range GL\_APPLE\_ycbcr\_422 GL\_APPLE\_texture\_range  
> \> \> \> \> GL\_APPLE\_pixel\_buffer GL\_NV\_blend\_square GL\_ATI\_texture\_env\_combine3  
> \> \> \> \> GL\_SGIS\_texture\_edge\_clamp GL\_SGIS\_texture\_lod   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> PTB-INFO: OpenGL-Renderer is Intel Inc. :: Intel GMA 950 OpenGL Engine  
> \> \> \> \> :: 1.2 APPLE-1.4.56  
> \> \> \> \> PTB-INFO: Renderer has 64 MB of VRAM and a maximum 64 MB of texture  
> \> \> \> \> memory.  
> \> \> \> \> PTB-Info: VBL startline = 800 , VBL Endline = -1  
> \> \> \> \> PTB-Info: Beamposition queries unsupported on this system. Will try to  
> \> \> \> \> use kernel-level vbl interrupts as fallback.  
> \> \> \> \> PTB-Info: Measured monitor refresh interval from VBLsync = 17.356896  
> \> \> \> \> ms [57.613989 Hz]. (57 valid samples taken, stddev=3.102240 ms.)  
> \> \> \> \> PTB-Info: Small deviations between reported values are normal and no  
> \> \> \> \> reason to worry.  
> \> \> \> \> PTB-INFO: Using OpenGL GL\_TEXTURE\_RECTANGLE\_EXT extension for  
> \> \> \> \> efficient high-performance texture mapping...  
> \> \> \> \>   
> \> \> \> \> WARNING: Couldn't compute a reliable estimate of monitor refresh  
> \> \> \> \> interval! Trouble with VBL syncing?!?  
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> ----- ! PTB - ERROR: SYNCHRONIZATION FAILURE ! ----  
> \> \> \> \>   
> \> \> \> \> One or more internal checks (see Warnings above) indicate that  
> \> \> \> \> synchronization  
> \> \> \> \> of Psychtoolbox to the vertical retrace (VBL) is not working on your  
> \> \> \> \> setup.  
> \> \> \> \>   
> \> \> \> \> This will seriously impair proper stimulus presentation and stimulus  
> \> \> \> \> presentation timing!  
> \> \> \> \> Please read 'help SyncTrouble' for information about how to solve or  
> \> \> \> \> work-around the problem.  
> \> \> \> \> You can force Psychtoolbox to continue, despite the severe problems,  
> \> \> \> \> by adding the command  
> \> \> \> \> Screen('Preference', 'SkipSyncTests',1); at the top of your script, if  
> \> \> \> \> you really know what you are doing.  
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> -------- END OUTPUT --------------------------------------  
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \>  
> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "andyleb" \<andyleb@\> wrote:  
> \> \> \> \> \>   
> \> \> \> \> \> \> 1. On my MacBook (regular, not MacBook Pro), the screen test  
> \> \> \> \> \> \> routinely fails. I understand the onboard graphics card is pretty  
> \> \> \> \> \> \> weak for this computer, but is it bad enough that the PTB Screen   
> \> \> \> \> \> \> can't work without skipping the sync test?  
> \> \> \> \> \>   
> \> \> \> \> \> Strange, worked on MacBook/IntelGMA when i tested it last time.  
> \> \> \> \> \> Provide PTB's Matlab output of the failure. I assume you run the  
> \> \> \> \> \> \*very latest\* 'beta'?  
> \> \> \> \> \>   
> \> \> \> \> \> You can always either completely skip the test or tell PTB to go  
> \> \> \> \> \> on in case of failure, you'll just lose our normally super-exact  
> \> \> \> \> \> timing if you do so -- or something else screws up if there was  
> \> \> \> \> \> a good severe reason for the sync-failure of course and not  
> \> \> \> \> \> only a noisy system.  
> \> \> \> \> \>   
> \> \> \> \> \> See: \<[http://psychtoolbox.org/wikka.php?wakka=FaqWarningPrefs](http://psychtoolbox.org/wikka.php?wakka=FaqWarningPrefs)\>  
> \> \> \> \> \>   
> \> \> \> \> \> or simply the help texts that PTB outputs in case of failure. I  
> \> \> assume  
> \> \> \> \> \> you read them?  
> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> 2. Kb commands don't accept any input on my Mac when a USB input  
> \> \> \> \> \> \> device is connected. That is, when a keyboard or mouse are  
> \> \> connected,  
> \> \> \> \> \> \> even the laptop's built-in keyboard is not recognized. Note  
> \> \> that this  
> \> \> \> \> \> \> only applies to Kb commands, as Char commands (e.g., GetChar)  
> \> \> still  
> \> \> \> \> \> \> works fine. Is this an issue with PsychHID?  
> \> \> \> \> \>   
> \> \> \> \> \> Also strange. I work all the time with a USB mouse connected and  
> \> \> \> \> \> we never heard of or experienced an issue like that.  
> \> \> \> \> \>   
> \> \> \> \> \> What is the output of "GetKeyboardIndices" in that case? What does  
> \> \> \> \> \> d=PsychHID('GetDevices') report? I mean of course the full content  
> \> \> \> \> \> of 'd' d(1), d(2), ....  
> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> 3. For windows, I've been having some trouble with the char  
> \> \> functions  
> \> \> \> \> \> \> (GetChar, ListenChar). I've seen this on 3 separate machines (two  
> \> \> \> \> \> \> using XP, one using 2000). Problems that occur are  
> \> \> idiosyncratic to  
> \> \> \> \> \> \> each machine, though. For instance, on one machine, after calling  
> \> \> \> \> \> \> GetChar or ListenChar, the Windows menubar becomes visible on the  
> \> \> \> \> \> \> bottom of the screen. On another machine, the Flip command stops  
> \> \> \> \> \> \> working normally; that is, when I specify the [dontclear]  
> \> \> parameter as  
> \> \> \> \> \> \> 1, the setting is ignored and the Flip command behaves as if I had  
> \> \> \> \> \> \> specified "2" (i.e., the backbuffer simply exchanges with the  
> \> \> front  
> \> \> \> \> \> \> buffer). To trigger this, I just need to add a Char command  
> \> \> anywhere  
> \> \> \> \> \> \> before a Flip command.   
> \> \> \> \> \>   
> \> \> \> \> \> Anybody else ever seen this? Which Matlab version is this? What  
> \> \> \> \> \> graphics card? Up to date drivers installed?  
> \> \> \> \> \>   
> \> \> \> \> \> There is no direct connection between 'Flip' and GetChar etc. but  
> \> \> \> \> \> you never know how Java's GetChar handling interacts with Matlabs  
> \> \> \> \> \> desktop UI and that with desktop manager gimmicks of the  
> \> \> \> \> \> graphics driver -- Windows is a mess.  
> \> \> \> \> \>   
> \> \> \> \> \> But the 'dontclear' setting 1 doesn't work on many Windows graphics  
> \> \> \> \> \> cards due to lack of features in the graphics drivers. If you have  
> \> \> \> \> \> recent graphics hardware and need that feature, then its  
> \> \> \> \> \> a good idea to enable the imaging pipeline by setting the  
> \> \> \> \> \> optional 'imagingMode' flag of Screen('OpenWindow', ...) to  
> \> \> \> \> \> kPsychNeedFastBackingStore.  
> \> \> \> \> \>   
> \> \> \> \> \> best,  
> \> \> \> \> \> -mario  
> \> \> \> \> \>  
> \> \> \> \>  
> \> \> \>  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [November 1, 2007, 4:38am UTC](https://psychtoolbox.discourse.group/t/macbook-synchronization-failure-kb-issues-getchar-issues/1265/4 "2007-11-01T04:38:20Z")

</div>

What happens if you switch the keyboards of  
your macMini and macTower? I'd expect the  
keyboards to be different in their behaviour.  
  
Did you try each key on the keyboard to make  
sure that none of them has an effect?  
  
if you do this:  
  
el=PsychHID('Elements', GetKeyboardIndices)  
  
what are the values of the following fields in the el array?  
 usagePageValue  
 usageValue  
 usageName  
  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "stevefranconeri" \<stevefranconeri@...\> wrote:  
> \>  
> \> Hi Mario -   
> \>   
> \> I am having the same problem as Andy, and after going through all of the suggested   
> fixes   
> \> in this thread, am having no luck. I'm on an Intel Mac Tower running 10.4.10, and   
> Matlab   
> \> 7.5 (2007b), and have the same trouble with 7.4. I've restarted the machine & Matlab   
> \> many times, reinstalled toobox, and have switched keyboards and usb slots. Control-C   
> \> works fine but I can't get KbCheck to register any other keys.   
> \>   
> \> The same code/debugging reveals no problems at all on a macmini in my lab -   
> everything   
> \> works great there yet it's the same OS & Matlab version. Is there something different   
> \> about my Tower's hardware? I've pasted a sample debug session below, and any help   
> \> would be greatly appreciated!   
> \>   
> \> -Steve  
> \> PS: after asking some friends using toolbox, some report a similar problem but for a   
> \> restart clears it for them.   
> \>   
> \>   
> \> \>\> KbDemo  
> \> 1 of 4. Testing KbCheck and KbName: press a key to see its number.  
> \> Press the escape key to proceed to the next demo.  
> \> d  
> \> s  
> \> sdlkdk  
> \> [pressed control-c]   
> \> ??? Operation terminated by user during ==\> KbCheck at 108  
> \>   
> \> In ==\> KbDemo\>KbDemoPart1 at 100  
> \> [keyIsDown, seconds, keyCode] = KbCheck;  
> \>   
> \> In ==\> KbDemo at 74  
> \> KbDemoPart1;  
> \>   
> \> \>\> WaitSecs(.2); KbWait  
> \> d  
> \> d  
> \> d  
> \> d  
> \>   
> \> [pressed control-c]   
> \> ??? Operation terminated by user during ==\> KbWait at 58  
> \>   
> \>   
> \> \>\> d=PsychHID('Devices')  
> \>   
> \> d =   
> \>   
> \> 1x2 struct array with fields:  
> \> usagePageValue  
> \> usageValue  
> \> usageName  
> \> index  
> \> transport  
> \> vendorID  
> \> productID  
> \> version  
> \> manufacturer  
> \> product  
> \> serialNumber  
> \> locationID  
> \> totalElements  
> \> features  
> \> inputs  
> \> outputs  
> \> collections  
> \> axes  
> \> buttons  
> \> hats  
> \> sliders  
> \> dials  
> \> wheels  
> \>   
> \> \>\> d(1)  
> \>   
> \> ans =   
> \>   
> \> usagePageValue: 1  
> \> usageValue: 2  
> \> usageName: 'Mouse'  
> \> index: 1  
> \> transport: 'USB'  
> \> vendorID: 1452  
> \> productID: 772  
> \> version: 272  
> \> manufacturer: 'Mitsumi Electric'  
> \> product: 'Apple Optical USB Mouse'  
> \> serialNumber: ''  
> \> locationID: 488767488  
> \> totalElements: 11  
> \> features: 0  
> \> inputs: 9  
> \> outputs: 0  
> \> collections: 2  
> \> axes: 3  
> \> buttons: 4  
> \> hats: 0  
> \> sliders: 0  
> \> dials: 0  
> \> wheels: 1  
> \>   
> \> \>\> d(2)  
> \>   
> \> ans =   
> \>   
> \> usagePageValue: 1  
> \> usageValue: 6  
> \> usageName: 'Keyboard'  
> \> index: 2  
> \> transport: 'USB'  
> \> vendorID: 1452  
> \> productID: 513  
> \> version: 257  
> \> manufacturer: 'Alps Electric'  
> \> product: 'M2452'  
> \> serialNumber: ''  
> \> locationID: 488701952  
> \> totalElements: 274  
> \> features: 0  
> \> inputs: 270  
> \> outputs: 3  
> \> collections: 1  
> \> axes: 0  
> \> buttons: 0  
> \> hats: 0  
> \> sliders: 0  
> \> dials: 0  
> \> wheels: 0  
> \>   
> \> \>\> GetKeyboardIndices  
> \>   
> \> ans =  
> \>   
> \> 2  
> \>   
> \> \>\> KbCheck(2)  
> \>   
> \> ans =  
> \>   
> \> 0  
> \>   
> \> Finally, if I put the above KbCheck(2) into a hand-coded KbWait, it never registers   
> \> anything.   
> \>   
> \>   
> \>   
> \>   
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner" \<mario.kleiner@\> wrote:  
> \> \>  
> \> \> \> 2. Failure of Kb commands on my Macbook when USB keyboard/mouse is  
> \> \> \> attached: I thought the problem went away after upgrading MATLAB to  
> \> \> \> r2007b, but it worked its way back into my life... As Mario  
> \> \> \> recommended, I'll paste below the full output from  
> \> \> \> devices=PsychHID('Devices') when the keyboard is attached. Nothing  
> \> \> \> seems abnormal from what I can tell (though that doesn't mean much!).  
> \> \>   
> \> \> What is the output of GetKeyboardIndices? If that lists the id's of your  
> \> \> two keyboards (built-in and external) and KbCheck doesn't throw  
> \> \> any errors when you use it, then the keyboards should get detected.  
> \> \>   
> \> \> If you pass the index to KbCheck, e.g.,  
> \> \>   
> \> \> KbCheck(3) for your USB kb or KbCheck(8) for your internal keyboard,  
> \> \> then at least query of the internal keyboard should work. By default  
> \> \> KbCheck will query the first keyboard (lowest index) it finds in your  
> \> \> system if you don't ask for a specific one - in this case the external  
> \> \> USB one, because 3 \< 8.  
> \> \>   
> \> \> Did you try all keys of the keyboard to see if some of them  
> \> \> get detected? Are there any special keys or switches on your kb?  
> \> \>   
> \> \> KbCheck only queries the keys with usb scancodes between 1 and  
> \> \> 255. It's a bit suspicious to me that your USB kb seems to have  
> \> \> more than 255 keys.  
> \> \>   
> \> \> Did you try with different USB keyboards?  
> \> \>   
> \> \> \>   
> \> \> \> 3. Char commands not working on PCs: I'm running XP with r2007b and  
> \> \> \> the latest updated version of PTB, as of last week. I just found out,  
> \> \> \> though, that Char commands have always had problems with the Java  
> \> \> \> virtual machine on Windows, i.e., since PTB2 times. As a Mac user, I  
> \> \> \> was totally unaware of this until yesterday when I went to install PTB  
> \> \> \> 2.54 on a windows machine. I found this on the download page  
> \> \> \> ([http://psychtoolbox.org/PTB-2/download.html)](http://psychtoolbox.org/PTB-2/download.html)):  
> \> \>   
> \> \> For Matlab R2007a and R2007b its the opposite, it wouldn't work with  
> \> \> -nojvm mode at the moment, because that .dll's are not yet ported  
> \> \> over. The Java based GetChar should work -- at least it does on  
> \> \> my R2007a + XP setup.  
> \> \>   
> \> \> I don't have 2007b on Windows, but you never know what  
> \> \> kind of new GetChar trouble Mathworks likes to introduce with  
> \> \> each new Matlab release. In general, GetChar is the most fragile  
> \> \> part of PTB, because it has to rely on Matlabs Java implementation,  
> \> \> which is in my experience the most prominent reason for Matlab  
> \> \> crashes/out of memory conditions/all kind of other trouble.  
> \> \> Matlabs interaction with the event queue is a complete black box  
> \> \> for us, not much we can do about that -- except finding new  
> \> \> weird workarounds for the weird trouble introduced with new  
> \> \> releases of Matlab. --\> Avoid GetChar if you can.  
> \> \>   
> \> \> -mario  
> \> \>   
> \> \> \>   
> \> \> \> "Nojvm" mode is required for GetChar because the Java Virtual Machine  
> \> \> \> (JVM) compoenent of MATLAB blocks keyboard input to the Psychtoolbox  
> \> \> \> functions GetChar and CharAvail.  
> \> \> \>   
> \> \> \> Is it the case that -nojvm is still required in PTB3 to use the Char  
> \> \> \> commands?  
> \> \> \>   
> \> \> \> Thanks!   
> \> \> \>   
> \> \> \> Andy  
> \> \> \>   
> \> \> \> ---------- Output for PsychHID devices -----------------------  
> \> \> \>   
> \> \> \> Device(1)  
> \> \> \>   
> \> \> \> usagePageValue: 12  
> \> \> \> usageValue: 1  
> \> \> \> usageName: 'Consumer Usage 0x1'  
> \> \> \> index: 1  
> \> \> \> transport: 'USB'  
> \> \> \> vendorID: 1452  
> \> \> \> productID: 33344  
> \> \> \> version: 272  
> \> \> \> manufacturer: 'Apple Computer, Inc.'  
> \> \> \> product: 'Apple IR'  
> \> \> \> serialNumber: ''  
> \> \> \> locationID: 1.5624e+09  
> \> \> \> totalElements: 21  
> \> \> \> features: 0  
> \> \> \> inputs: 20  
> \> \> \> outputs: 0  
> \> \> \> collections: 1  
> \> \> \> axes: 0  
> \> \> \> buttons: 0  
> \> \> \> hats: 0  
> \> \> \> sliders: 0  
> \> \> \> dials: 0  
> \> \> \> wheels: 0  
> \> \> \>   
> \> \> \> Device(2)  
> \> \> \>   
> \> \> \> usagePageValue: 1  
> \> \> \> usageValue: 128  
> \> \> \> usageName: 'System Control'  
> \> \> \> index: 2  
> \> \> \> transport: 'USB'  
> \> \> \> vendorID: 2689  
> \> \> \> productID: 257  
> \> \> \> version: 272  
> \> \> \> manufacturer: 'CHESEN'  
> \> \> \> product: 'USB Keyboard'  
> \> \> \> serialNumber: ''  
> \> \> \> locationID: 1.0245e+09  
> \> \> \> totalElements: 29  
> \> \> \> features: 0  
> \> \> \> inputs: 27  
> \> \> \> outputs: 0  
> \> \> \> collections: 2  
> \> \> \> axes: 0  
> \> \> \> buttons: 0  
> \> \> \> hats: 0  
> \> \> \> sliders: 0  
> \> \> \> dials: 0  
> \> \> \> wheels: 0  
> \> \> \>   
> \> \> \> Device(3)  
> \> \> \>   
> \> \> \> usagePageValue: 1  
> \> \> \> usageValue: 6  
> \> \> \> usageName: 'Keyboard'  
> \> \> \> index: 3  
> \> \> \> transport: 'USB'  
> \> \> \> vendorID: 2689  
> \> \> \> productID: 257  
> \> \> \> version: 272  
> \> \> \> manufacturer: 'CHESEN'  
> \> \> \> product: 'USB Keyboard'  
> \> \> \> serialNumber: ''  
> \> \> \> locationID: 1.0245e+09  
> \> \> \> totalElements: 276  
> \> \> \> features: 0  
> \> \> \> inputs: 270  
> \> \> \> outputs: 5  
> \> \> \> collections: 1  
> \> \> \> axes: 0  
> \> \> \> buttons: 0  
> \> \> \> hats: 0  
> \> \> \> sliders: 0  
> \> \> \> dials: 0  
> \> \> \> wheels: 0  
> \> \> \>   
> \> \> \>   
> \> \> \> Device(4)  
> \> \> \>   
> \> \> \> usagePageValue: 12  
> \> \> \> usageValue: 1  
> \> \> \> usageName: 'Consumer Usage 0x1'  
> \> \> \> index: 4  
> \> \> \> transport: 'USB'  
> \> \> \> vendorID: 1452  
> \> \> \> productID: 538  
> \> \> \> version: 19  
> \> \> \> manufacturer: 'Apple Computer'  
> \> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> \> serialNumber: ''  
> \> \> \> locationID: 488636416  
> \> \> \> totalElements: 2  
> \> \> \> features: 0  
> \> \> \> inputs: 1  
> \> \> \> outputs: 0  
> \> \> \> collections: 1  
> \> \> \> axes: 0  
> \> \> \> buttons: 0  
> \> \> \> hats: 0  
> \> \> \> sliders: 0  
> \> \> \> dials: 0  
> \> \> \> wheels: 0  
> \> \> \>   
> \> \> \>   
> \> \> \> Device(5)  
> \> \> \>   
> \> \> \> usagePageValue: 1  
> \> \> \> usageValue: 2  
> \> \> \> usageName: 'Mouse'  
> \> \> \> index: 5  
> \> \> \> transport: 'USB'  
> \> \> \> vendorID: 1452  
> \> \> \> productID: 538  
> \> \> \> version: 0  
> \> \> \> manufacturer: 'Apple Computer'  
> \> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> \> serialNumber: '0'  
> \> \> \> locationID: 488636416  
> \> \> \> totalElements: 6  
> \> \> \> features: 0  
> \> \> \> inputs: 4  
> \> \> \> outputs: 0  
> \> \> \> collections: 2  
> \> \> \> axes: 2  
> \> \> \> buttons: 1  
> \> \> \> hats: 0  
> \> \> \> sliders: 0  
> \> \> \> dials: 0  
> \> \> \> wheels: 1  
> \> \> \>   
> \> \> \> Device(6)  
> \> \> \>   
> \> \> \> usagePageValue: 255  
> \> \> \> usageValue: 1  
> \> \> \> usageName: 'Page: 0xff, Usage: 0x1'  
> \> \> \> index: 6  
> \> \> \> transport: 'USB'  
> \> \> \> vendorID: 1452  
> \> \> \> productID: 538  
> \> \> \> version: 0  
> \> \> \> manufacturer: 'Apple'  
> \> \> \> product: 'Trackpad'  
> \> \> \> serialNumber: ''  
> \> \> \> locationID: 488636416  
> \> \> \> totalElements: 20  
> \> \> \> features: 17  
> \> \> \> inputs: 2  
> \> \> \> outputs: 0  
> \> \> \> collections: 1  
> \> \> \> axes: 0  
> \> \> \> buttons: 0  
> \> \> \> hats: 0  
> \> \> \> sliders: 0  
> \> \> \> dials: 0  
> \> \> \> wheels: 0  
> \> \> \>   
> \> \> \> Device(7)  
> \> \> \>   
> \> \> \> usagePageValue: 1  
> \> \> \> usageValue: 2  
> \> \> \> usageName: 'Mouse'  
> \> \> \> index: 7  
> \> \> \> transport: 'USB'  
> \> \> \> vendorID: 1452  
> \> \> \> productID: 538  
> \> \> \> version: 0  
> \> \> \> manufacturer: 'Apple'  
> \> \> \> product: 'Trackpad'  
> \> \> \> serialNumber: ''  
> \> \> \> locationID: 488636416  
> \> \> \> totalElements: 27  
> \> \> \> features: 17  
> \> \> \> inputs: 7  
> \> \> \> outputs: 0  
> \> \> \> collections: 3  
> \> \> \> axes: 2  
> \> \> \> buttons: 3  
> \> \> \> hats: 0  
> \> \> \> sliders: 0  
> \> \> \> dials: 0  
> \> \> \> wheels: 0  
> \> \> \>   
> \> \> \> Device(8)  
> \> \> \>   
> \> \> \> usagePageValue: 1  
> \> \> \> usageValue: 6  
> \> \> \> usageName: 'Keyboard'  
> \> \> \> index: 8  
> \> \> \> transport: 'USB'  
> \> \> \> vendorID: 1452  
> \> \> \> productID: 538  
> \> \> \> version: 19  
> \> \> \> manufacturer: 'Apple Computer'  
> \> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> \> serialNumber: ''  
> \> \> \> locationID: 488636416  
> \> \> \> totalElements: 244  
> \> \> \> features: 0  
> \> \> \> inputs: 238  
> \> \> \> outputs: 5  
> \> \> \> collections: 1  
> \> \> \> axes: 0  
> \> \> \> buttons: 0  
> \> \> \> hats: 0  
> \> \> \> sliders: 0  
> \> \> \> dials: 0  
> \> \> \> wheels: 0  
> \> \> \>   
> \> \> \> --------------- end output -----------------------------------  
> \> \> \>   
> \> \> \>   
> \> \> \>   
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \>  
> \> \> \> \> Reg. Sync failures: If you open your window by providing a  
> \> \> \> \> rect parameter of e.g., [0 0 640 480], so it only covers part  
> \> \> \> \> of the screen, yes, you may get more sync failures and a  
> \> \> \> \> generally unusable timing for real work. This mode is ok  
> \> \> \> \> for debugging your script etc., but not for timing tests or  
> \> \> \> \> real data collection. The OS/X Quartz window manager  
> \> \> \> \> interferes with presentation timing and timestamping in  
> \> \> \> \> windowed mode, and probably even more so on a weak  
> \> \> \> \> GMA-950. But even with high-end graphics you wouldn't  
> \> \> \> \> get good enough timing. Just use the 'SkipSyncTests' setting  
> \> \> \> \> during development/debugging of your script and remove  
> \> \> \> \> it for real data collection.  
> \> \> \> \>   
> \> \> \> \> -mario  
> \> \> \> \>   
> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "andyleb" \<andyleb@\> wrote:  
> \> \> \> \> \>  
> \> \> \> \> \> Hi Mario,  
> \> \> \> \> \>   
> \> \> \> \> \> Thanks so much for replying. At the time I posted, I was running  
> \> \> \> \> \> PTB3's \*very\* latest beta, with matlab2006a (7.4). Since then, I've  
> \> \> \> \> \> upgraded to matlab2006b (7.5) and reinstalled PTB3-beta. I also  
> \> \> \> \> \> updated to the most recent version of quicktime.  
> \> \> \> \> \>   
> \> \> \> \> \> 1. Sync failures. I realized that it's much more likely to occur  
> \> \> \> \> \> when my main window is smaller than the full size of my display (e.g.,  
> \> \> \> \> \> 640x480 in a 1280x800 screen). Did I wrongly assume we can open small  
> \> \> \> \> \> windows in OS X without syncing trouble? The output is pasted into  
> \> \> \> \> \> this message (please scroll down).  
> \> \> \> \> \>   
> \> \> \> \> \> 2. USB device trouble. Since upgrading, I haven't had this problem  
> \> \> \> \> \> at all. Maybe I just had a buggy install of matlab 2006a?  
> \> \> \> \> \>   
> \> \> \> \> \> 3. I'm still looking into the Char problems on the various windows  
> \> \> \> \> \> machines, based on your recommendations. I'll post on those  
> \> \> \> \> \> separately. I'd also like to hear if anyone else has experienced  
> \> \> \> \> \> these problems.  
> \> \> \> \> \>   
> \> \> \> \> \> Thanks so much for your help!!  
> \> \> \> \> \>   
> \> \> \> \> \> Andy  
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \> -------- SYNC FAILURE OUTPUT --------------------------------------  
> \> \> \> \> \>   
> \> \> \> \> \> PTB-INFO: This is the OpenGL-Psychtoolbox version 3.0.8. Type  
> \> \> \> \> \> 'PsychtoolboxVersion' for more detailed version information.  
> \> \> \> \> \> PTB-INFO: Psychtoolbox is licensed to you under terms of the GNU  
> \> \> \> \> \> General Public License (GPL). See file 'License.txt' in the  
> \> \> \> \> \> PTB-INFO: Psychtoolbox root folder for a copy of the GPL license.  
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \> OpenGL-Extensions are: GL\_ARB\_transpose\_matrix GL\_ARB\_vertex\_program  
> \> \> \> \> \> GL\_ARB\_vertex\_blend GL\_ARB\_window\_pos GL\_ARB\_shader\_objects  
> \> \> \> \> \> GL\_ARB\_vertex\_shader GL\_EXT\_multi\_draw\_arrays GL\_EXT\_clip\_volume\_hint  
> \> \> \> \> \> GL\_EXT\_rescale\_normal GL\_EXT\_draw\_range\_elements GL\_EXT\_fog\_coord  
> \> \> \> \> \> GL\_EXT\_gpu\_program\_parameters GL\_APPLE\_client\_storage  
> \> \> \> \> \> GL\_APPLE\_specular\_vector GL\_APPLE\_transform\_hint  
> \> \> \> \> \> GL\_APPLE\_packed\_pixels GL\_APPLE\_fence GL\_APPLE\_vertex\_array\_object  
> \> \> \> \> \> GL\_APPLE\_vertex\_program\_evaluators GL\_APPLE\_element\_array  
> \> \> \> \> \> GL\_APPLE\_flush\_render GL\_NV\_texgen\_reflection GL\_NV\_light\_max\_exponent  
> \> \> \> \> \> GL\_IBM\_rasterpos\_clip GL\_SGIS\_generate\_mipmap  
> \> \> \> \> \> GL\_ARB\_shading\_language\_100 GL\_ARB\_texture\_border\_clamp  
> \> \> \> \> \> GL\_ARB\_multitexture GL\_ARB\_texture\_env\_add GL\_ARB\_texture\_cube\_map  
> \> \> \> \> \> GL\_ARB\_texture\_env\_dot3 GL\_ARB\_texture\_env\_combine  
> \> \> \> \> \> GL\_ARB\_texture\_compression GL\_ARB\_texture\_mirrored\_repeat  
> \> \> \> \> \> GL\_ARB\_shadow GL\_ARB\_depth\_texture GL\_ARB\_fragment\_program  
> \> \> \> \> \> GL\_ARB\_fragment\_shader GL\_ARB\_point\_sprite  
> \> \> \> \> \> GL\_ARB\_texture\_non\_power\_of\_two GL\_ARB\_vertex\_buffer\_object  
> \> \> \> \> \> GL\_ARB\_pixel\_buffer\_object GL\_EXT\_framebuffer\_object  
> \> \> \> \> \> GL\_EXT\_texture\_rectangle GL\_ARB\_texture\_rectangle  
> \> \> \> \> \> GL\_EXT\_texture\_env\_add GL\_EXT\_blend\_color GL\_EXT\_blend\_minmax  
> \> \> \> \> \> GL\_EXT\_blend\_subtract GL\_EXT\_texture\_lod\_bias GL\_EXT\_abgr GL\_EXT\_bgra  
> \> \> \> \> \> GL\_EXT\_stencil\_wrap GL\_EXT\_texture\_filter\_anisotropic  
> \> \> \> \> \> GL\_EXT\_separate\_specular\_color GL\_EXT\_secondary\_color  
> \> \> \> \> \> GL\_EXT\_blend\_func\_separate GL\_EXT\_shadow\_funcs GL\_EXT\_stencil\_two\_side  
> \> \> \> \> \> GL\_EXT\_texture\_compression\_s3tc GL\_EXT\_texture\_compression\_dxt1  
> \> \> \> \> \> GL\_EXT\_blend\_equation\_separate GL\_EXT\_packed\_depth\_stencil  
> \> \> \> \> \> GL\_APPLE\_flush\_buffer\_range GL\_APPLE\_ycbcr\_422 GL\_APPLE\_texture\_range  
> \> \> \> \> \> GL\_APPLE\_pixel\_buffer GL\_NV\_blend\_square GL\_ATI\_texture\_env\_combine3  
> \> \> \> \> \> GL\_SGIS\_texture\_edge\_clamp GL\_SGIS\_texture\_lod   
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \> PTB-INFO: OpenGL-Renderer is Intel Inc. :: Intel GMA 950 OpenGL Engine  
> \> \> \> \> \> :: 1.2 APPLE-1.4.56  
> \> \> \> \> \> PTB-INFO: Renderer has 64 MB of VRAM and a maximum 64 MB of texture  
> \> \> \> \> \> memory.  
> \> \> \> \> \> PTB-Info: VBL startline = 800 , VBL Endline = -1  
> \> \> \> \> \> PTB-Info: Beamposition queries unsupported on this system. Will try to  
> \> \> \> \> \> use kernel-level vbl interrupts as fallback.  
> \> \> \> \> \> PTB-Info: Measured monitor refresh interval from VBLsync = 17.356896  
> \> \> \> \> \> ms [57.613989 Hz]. (57 valid samples taken, stddev=3.102240 ms.)  
> \> \> \> \> \> PTB-Info: Small deviations between reported values are normal and no  
> \> \> \> \> \> reason to worry.  
> \> \> \> \> \> PTB-INFO: Using OpenGL GL\_TEXTURE\_RECTANGLE\_EXT extension for  
> \> \> \> \> \> efficient high-performance texture mapping...  
> \> \> \> \> \>   
> \> \> \> \> \> WARNING: Couldn't compute a reliable estimate of monitor refresh  
> \> \> \> \> \> interval! Trouble with VBL syncing?!?  
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \> ----- ! PTB - ERROR: SYNCHRONIZATION FAILURE ! ----  
> \> \> \> \> \>   
> \> \> \> \> \> One or more internal checks (see Warnings above) indicate that  
> \> \> \> \> \> synchronization  
> \> \> \> \> \> of Psychtoolbox to the vertical retrace (VBL) is not working on your  
> \> \> \> \> \> setup.  
> \> \> \> \> \>   
> \> \> \> \> \> This will seriously impair proper stimulus presentation and stimulus  
> \> \> \> \> \> presentation timing!  
> \> \> \> \> \> Please read 'help SyncTrouble' for information about how to solve or  
> \> \> \> \> \> work-around the problem.  
> \> \> \> \> \> You can force Psychtoolbox to continue, despite the severe problems,  
> \> \> \> \> \> by adding the command  
> \> \> \> \> \> Screen('Preference', 'SkipSyncTests',1); at the top of your script, if  
> \> \> \> \> \> you really know what you are doing.  
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \> -------- END OUTPUT --------------------------------------  
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \> \>  
> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "andyleb" \<andyleb@\> wrote:  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> 1. On my MacBook (regular, not MacBook Pro), the screen test  
> \> \> \> \> \> \> \> routinely fails. I understand the onboard graphics card is pretty  
> \> \> \> \> \> \> \> weak for this computer, but is it bad enough that the PTB Screen   
> \> \> \> \> \> \> \> can't work without skipping the sync test?  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Strange, worked on MacBook/IntelGMA when i tested it last time.  
> \> \> \> \> \> \> Provide PTB's Matlab output of the failure. I assume you run the  
> \> \> \> \> \> \> \*very latest\* 'beta'?  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> You can always either completely skip the test or tell PTB to go  
> \> \> \> \> \> \> on in case of failure, you'll just lose our normally super-exact  
> \> \> \> \> \> \> timing if you do so -- or something else screws up if there was  
> \> \> \> \> \> \> a good severe reason for the sync-failure of course and not  
> \> \> \> \> \> \> only a noisy system.  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> See: \<[http://psychtoolbox.org/wikka.php?wakka=FaqWarningPrefs](http://psychtoolbox.org/wikka.php?wakka=FaqWarningPrefs)\>  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> or simply the help texts that PTB outputs in case of failure. I  
> \> \> \> assume  
> \> \> \> \> \> \> you read them?  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> 2. Kb commands don't accept any input on my Mac when a USB input  
> \> \> \> \> \> \> \> device is connected. That is, when a keyboard or mouse are  
> \> \> \> connected,  
> \> \> \> \> \> \> \> even the laptop's built-in keyboard is not recognized. Note  
> \> \> \> that this  
> \> \> \> \> \> \> \> only applies to Kb commands, as Char commands (e.g., GetChar)  
> \> \> \> still  
> \> \> \> \> \> \> \> works fine. Is this an issue with PsychHID?  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Also strange. I work all the time with a USB mouse connected and  
> \> \> \> \> \> \> we never heard of or experienced an issue like that.  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> What is the output of "GetKeyboardIndices" in that case? What does  
> \> \> \> \> \> \> d=PsychHID('GetDevices') report? I mean of course the full content  
> \> \> \> \> \> \> of 'd' d(1), d(2), ....  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> 3. For windows, I've been having some trouble with the char  
> \> \> \> functions  
> \> \> \> \> \> \> \> (GetChar, ListenChar). I've seen this on 3 separate machines (two  
> \> \> \> \> \> \> \> using XP, one using 2000). Problems that occur are  
> \> \> \> idiosyncratic to  
> \> \> \> \> \> \> \> each machine, though. For instance, on one machine, after calling  
> \> \> \> \> \> \> \> GetChar or ListenChar, the Windows menubar becomes visible on the  
> \> \> \> \> \> \> \> bottom of the screen. On another machine, the Flip command stops  
> \> \> \> \> \> \> \> working normally; that is, when I specify the [dontclear]  
> \> \> \> parameter as  
> \> \> \> \> \> \> \> 1, the setting is ignored and the Flip command behaves as if I had  
> \> \> \> \> \> \> \> specified "2" (i.e., the backbuffer simply exchanges with the  
> \> \> \> front  
> \> \> \> \> \> \> \> buffer). To trigger this, I just need to add a Char command  
> \> \> \> anywhere  
> \> \> \> \> \> \> \> before a Flip command.   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Anybody else ever seen this? Which Matlab version is this? What  
> \> \> \> \> \> \> graphics card? Up to date drivers installed?  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> There is no direct connection between 'Flip' and GetChar etc. but  
> \> \> \> \> \> \> you never know how Java's GetChar handling interacts with Matlabs  
> \> \> \> \> \> \> desktop UI and that with desktop manager gimmicks of the  
> \> \> \> \> \> \> graphics driver -- Windows is a mess.  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> But the 'dontclear' setting 1 doesn't work on many Windows graphics  
> \> \> \> \> \> \> cards due to lack of features in the graphics drivers. If you have  
> \> \> \> \> \> \> recent graphics hardware and need that feature, then its  
> \> \> \> \> \> \> a good idea to enable the imaging pipeline by setting the  
> \> \> \> \> \> \> optional 'imagingMode' flag of Screen('OpenWindow', ...) to  
> \> \> \> \> \> \> kPsychNeedFastBackingStore.  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> best,  
> \> \> \> \> \> \> -mario  
> \> \> \> \> \> \>  
> \> \> \> \> \>  
> \> \> \> \>  
> \> \> \>  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [December 5, 2007, 9:41pm UTC](https://psychtoolbox.discourse.group/t/macbook-synchronization-failure-kb-issues-getchar-issues/1265/5 "2007-12-05T21:41:07Z")

</div>

I too had problems getting input from the keyboard. My program would  
alternate between working fine and then having a period (about 10s)  
during which it would not receive any input at all. This would all  
happen during a single experimental run.  
  
It affected only 3 out of 6 computers, all running Mac OS 10.4.11, the  
latest version of MATLAB (7.5.0.338 R2007b) and the latest version of  
PsychToolbox ("3.0.8 - Flavor: beta - Corresponds to SVN Revision 884  
but is \*locally modified\* !").  
  
Strangely, two of these computers were (as far as I could make out)  
identical, yet the code worked on one but not on the other.  
  
  
The problem, turned out to be one line of code  
  

> \>\> Priority(MaxPriority(MainWindow));

When this line was removed, everything worked fine.   
  
Piers  
  
  
  
--- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "stevefranconeri"  
\<stevefranconeri@...\> wrote:  

> \>  
> \>   
> \>   
> \> Here's the answer!   
> \>   
> \> After many iterations back and forth with Mario Kleiner, he

suggested that I test another   

> \> account on the same machine. Strangely, kbDemo worked just fine.   
> \>   
> \> After some experimentation, I finally figured it out. Under my

account's "Login Items"   

> \> pane in the account admin control panel, there were some

utilities/drivers that had been   

> \> installed by past programs (many involving 'USB"), including one

suspiciously called "ABF   

> \> HotKey", which was installed by some shareware utility. I deleted

all the nonessential   

> \> ones, and now my KB works just fine. I think it was that ABF one

that was causing the   

> \> problem. This explains why it was only my account that had KB trouble.  
> \>   
> \> Many thanks once again to Mario for all of his help.   
> \>   
> \> -Steve  
> \>   
> \>   
> \>   
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "stevefranconeri"

\<stevefranconeri@\> wrote:  

> \> \>  
> \> \> Mario -   
> \> \>   
> \> \> Switching the keyboard for another one (from a macmini running the

same OS/Matlab   

> \> \> version) does nothing - the problem is specific to my mactel

tower. I also hit every key   

> \> \> (except the F1-12 keys) on each keyboard.   
> \> \>   
> \> \> I ran the commands you suggested, and posted the output here:   
> \> \> [http://www.psych.northwestern.edu/~franconeri/KbCheckProblem.txt](http://www.psych.northwestern.edu/~franconeri/KbCheckProblem.txt)  
> \> \>   
> \> \> many thanks!  
> \> \> -Steve  
> \> \>   
> \> \>   
> \> \>   
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"

\<mario.kleiner@\> wrote:  

> \> \> \>  
> \> \> \> What happens if you switch the keyboards of  
> \> \> \> your macMini and macTower? I'd expect the  
> \> \> \> keyboards to be different in their behaviour.  
> \> \> \>   
> \> \> \> Did you try each key on the keyboard to make  
> \> \> \> sure that none of them has an effect?  
> \> \> \>   
> \> \> \> if you do this:  
> \> \> \>   
> \> \> \> el=PsychHID('Elements', GetKeyboardIndices)  
> \> \> \>   
> \> \> \> what are the values of the following fields in the el array?  
> \> \> \> usagePageValue  
> \> \> \> usageValue  
> \> \> \> usageName  
> \> \> \>   
> \> \> \> -mario  
> \> \> \>   
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "stevefranconeri"

\<stevefranconeri@\> wrote:  

> \> \> \> \>  
> \> \> \> \> Hi Mario -   
> \> \> \> \>   
> \> \> \> \> I am having the same problem as Andy, and after going through

all of the   

> \> suggested   
> \> \> \> fixes   
> \> \> \> \> in this thread, am having no luck. I'm on an Intel Mac Tower

running 10.4.10, and   

> \> \> \> Matlab   
> \> \> \> \> 7.5 (2007b), and have the same trouble with 7.4. I've

restarted the machine &   

> \> Matlab   
> \> \> \> \> many times, reinstalled toobox, and have switched keyboards

and usb slots.   

> \> Control-  
> \> \> C   
> \> \> \> \> works fine but I can't get KbCheck to register any other keys.   
> \> \> \> \>   
> \> \> \> \> The same code/debugging reveals no problems at all on a

macmini in my lab -   

> \> \> \> everything   
> \> \> \> \> works great there yet it's the same OS & Matlab version. Is

there something   

> \> different   
> \> \> \> \> about my Tower's hardware? I've pasted a sample debug session

below, and any   

> \> help   
> \> \> \> \> would be greatly appreciated!   
> \> \> \> \>   
> \> \> \> \> -Steve  
> \> \> \> \> PS: after asking some friends using toolbox, some report a

similar problem but for a   

> \> \> \> \> restart clears it for them.   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> \>\> KbDemo  
> \> \> \> \> 1 of 4. Testing KbCheck and KbName: press a key to see its

number.  

> \> \> \> \> Press the escape key to proceed to the next demo.  
> \> \> \> \> d  
> \> \> \> \> s  
> \> \> \> \> sdlkdk  
> \> \> \> \> [pressed control-c]   
> \> \> \> \> ??? Operation terminated by user during ==\> KbCheck at 108  
> \> \> \> \>   
> \> \> \> \> In ==\> KbDemo\>KbDemoPart1 at 100  
> \> \> \> \> [keyIsDown, seconds, keyCode] = KbCheck;  
> \> \> \> \>   
> \> \> \> \> In ==\> KbDemo at 74  
> \> \> \> \> KbDemoPart1;  
> \> \> \> \>   
> \> \> \> \> \>\> WaitSecs(.2); KbWait  
> \> \> \> \> d  
> \> \> \> \> d  
> \> \> \> \> d  
> \> \> \> \> d  
> \> \> \> \>   
> \> \> \> \> [pressed control-c]   
> \> \> \> \> ??? Operation terminated by user during ==\> KbWait at 58  
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> \>\> d=PsychHID('Devices')  
> \> \> \> \>   
> \> \> \> \> d =   
> \> \> \> \>   
> \> \> \> \> 1x2 struct array with fields:  
> \> \> \> \> usagePageValue  
> \> \> \> \> usageValue  
> \> \> \> \> usageName  
> \> \> \> \> index  
> \> \> \> \> transport  
> \> \> \> \> vendorID  
> \> \> \> \> productID  
> \> \> \> \> version  
> \> \> \> \> manufacturer  
> \> \> \> \> product  
> \> \> \> \> serialNumber  
> \> \> \> \> locationID  
> \> \> \> \> totalElements  
> \> \> \> \> features  
> \> \> \> \> inputs  
> \> \> \> \> outputs  
> \> \> \> \> collections  
> \> \> \> \> axes  
> \> \> \> \> buttons  
> \> \> \> \> hats  
> \> \> \> \> sliders  
> \> \> \> \> dials  
> \> \> \> \> wheels  
> \> \> \> \>   
> \> \> \> \> \>\> d(1)  
> \> \> \> \>   
> \> \> \> \> ans =   
> \> \> \> \>   
> \> \> \> \> usagePageValue: 1  
> \> \> \> \> usageValue: 2  
> \> \> \> \> usageName: 'Mouse'  
> \> \> \> \> index: 1  
> \> \> \> \> transport: 'USB'  
> \> \> \> \> vendorID: 1452  
> \> \> \> \> productID: 772  
> \> \> \> \> version: 272  
> \> \> \> \> manufacturer: 'Mitsumi Electric'  
> \> \> \> \> product: 'Apple Optical USB Mouse'  
> \> \> \> \> serialNumber: ''  
> \> \> \> \> locationID: 488767488  
> \> \> \> \> totalElements: 11  
> \> \> \> \> features: 0  
> \> \> \> \> inputs: 9  
> \> \> \> \> outputs: 0  
> \> \> \> \> collections: 2  
> \> \> \> \> axes: 3  
> \> \> \> \> buttons: 4  
> \> \> \> \> hats: 0  
> \> \> \> \> sliders: 0  
> \> \> \> \> dials: 0  
> \> \> \> \> wheels: 1  
> \> \> \> \>   
> \> \> \> \> \>\> d(2)  
> \> \> \> \>   
> \> \> \> \> ans =   
> \> \> \> \>   
> \> \> \> \> usagePageValue: 1  
> \> \> \> \> usageValue: 6  
> \> \> \> \> usageName: 'Keyboard'  
> \> \> \> \> index: 2  
> \> \> \> \> transport: 'USB'  
> \> \> \> \> vendorID: 1452  
> \> \> \> \> productID: 513  
> \> \> \> \> version: 257  
> \> \> \> \> manufacturer: 'Alps Electric'  
> \> \> \> \> product: 'M2452'  
> \> \> \> \> serialNumber: ''  
> \> \> \> \> locationID: 488701952  
> \> \> \> \> totalElements: 274  
> \> \> \> \> features: 0  
> \> \> \> \> inputs: 270  
> \> \> \> \> outputs: 3  
> \> \> \> \> collections: 1  
> \> \> \> \> axes: 0  
> \> \> \> \> buttons: 0  
> \> \> \> \> hats: 0  
> \> \> \> \> sliders: 0  
> \> \> \> \> dials: 0  
> \> \> \> \> wheels: 0  
> \> \> \> \>   
> \> \> \> \> \>\> GetKeyboardIndices  
> \> \> \> \>   
> \> \> \> \> ans =  
> \> \> \> \>   
> \> \> \> \> 2  
> \> \> \> \>   
> \> \> \> \> \>\> KbCheck(2)  
> \> \> \> \>   
> \> \> \> \> ans =  
> \> \> \> \>   
> \> \> \> \> 0  
> \> \> \> \>   
> \> \> \> \> Finally, if I put the above KbCheck(2) into a hand-coded

KbWait, it never registers   

> \> \> \> \> anything.   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \>   
> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"

\<mario.kleiner@\> wrote:  

> \> \> \> \> \>  
> \> \> \> \> \> \> 2. Failure of Kb commands on my Macbook when USB

keyboard/mouse is  

> \> \> \> \> \> \> attached: I thought the problem went away after upgrading

MATLAB to  

> \> \> \> \> \> \> r2007b, but it worked its way back into my life... As Mario  
> \> \> \> \> \> \> recommended, I'll paste below the full output from  
> \> \> \> \> \> \> devices=PsychHID('Devices') when the keyboard is attached.

 Nothing  

> \> \> \> \> \> \> seems abnormal from what I can tell (though that doesn't

mean much!).  

> \> \> \> \> \>   
> \> \> \> \> \> What is the output of GetKeyboardIndices? If that lists the

id's of your  

> \> \> \> \> \> two keyboards (built-in and external) and KbCheck doesn't throw  
> \> \> \> \> \> any errors when you use it, then the keyboards should get

detected.  

> \> \> \> \> \>   
> \> \> \> \> \> If you pass the index to KbCheck, e.g.,  
> \> \> \> \> \>   
> \> \> \> \> \> KbCheck(3) for your USB kb or KbCheck(8) for your internal

keyboard,  

> \> \> \> \> \> then at least query of the internal keyboard should work. By

default  

> \> \> \> \> \> KbCheck will query the first keyboard (lowest index) it

finds in your  

> \> \> \> \> \> system if you don't ask for a specific one - in this case

the external  

> \> \> \> \> \> USB one, because 3 \< 8.  
> \> \> \> \> \>   
> \> \> \> \> \> Did you try all keys of the keyboard to see if some of them  
> \> \> \> \> \> get detected? Are there any special keys or switches on your kb?  
> \> \> \> \> \>   
> \> \> \> \> \> KbCheck only queries the keys with usb scancodes between 1 and  
> \> \> \> \> \> 255. It's a bit suspicious to me that your USB kb seems to have  
> \> \> \> \> \> more than 255 keys.  
> \> \> \> \> \>   
> \> \> \> \> \> Did you try with different USB keyboards?  
> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> 3. Char commands not working on PCs: I'm running XP with

r2007b and  

> \> \> \> \> \> \> the latest updated version of PTB, as of last week. I

just found out,  

> \> \> \> \> \> \> though, that Char commands have always had problems with

the Java  

> \> \> \> \> \> \> virtual machine on Windows, i.e., since PTB2 times. As a

Mac user, I  

> \> \> \> \> \> \> was totally unaware of this until yesterday when I went to

install PTB  

> \> \> \> \> \> \> 2.54 on a windows machine. I found this on the download page  
> \> \> \> \> \> \> ([http://psychtoolbox.org/PTB-2/download.html)](http://psychtoolbox.org/PTB-2/download.html)):  
> \> \> \> \> \>   
> \> \> \> \> \> For Matlab R2007a and R2007b its the opposite, it wouldn't

work with  

> \> \> \> \> \> -nojvm mode at the moment, because that .dll's are not yet

ported  

> \> \> \> \> \> over. The Java based GetChar should work -- at least it does on  
> \> \> \> \> \> my R2007a + XP setup.  
> \> \> \> \> \>   
> \> \> \> \> \> I don't have 2007b on Windows, but you never know what  
> \> \> \> \> \> kind of new GetChar trouble Mathworks likes to introduce with  
> \> \> \> \> \> each new Matlab release. In general, GetChar is the most fragile  
> \> \> \> \> \> part of PTB, because it has to rely on Matlabs Java

implementation,  

> \> \> \> \> \> which is in my experience the most prominent reason for Matlab  
> \> \> \> \> \> crashes/out of memory conditions/all kind of other trouble.  
> \> \> \> \> \> Matlabs interaction with the event queue is a complete black box  
> \> \> \> \> \> for us, not much we can do about that -- except finding new  
> \> \> \> \> \> weird workarounds for the weird trouble introduced with new  
> \> \> \> \> \> releases of Matlab. --\> Avoid GetChar if you can.  
> \> \> \> \> \>   
> \> \> \> \> \> -mario  
> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> "Nojvm" mode is required for GetChar because the Java

Virtual Machine  

> \> \> \> \> \> \> (JVM) compoenent of MATLAB blocks keyboard input to the

Psychtoolbox  

> \> \> \> \> \> \> functions GetChar and CharAvail.  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Is it the case that -nojvm is still required in PTB3 to

use the Char  

> \> \> \> \> \> \> commands?  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Thanks!   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Andy  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> ---------- Output for PsychHID devices -----------------------  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Device(1)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> usagePageValue: 12  
> \> \> \> \> \> \> usageValue: 1  
> \> \> \> \> \> \> usageName: 'Consumer Usage 0x1'  
> \> \> \> \> \> \> index: 1  
> \> \> \> \> \> \> transport: 'USB'  
> \> \> \> \> \> \> vendorID: 1452  
> \> \> \> \> \> \> productID: 33344  
> \> \> \> \> \> \> version: 272  
> \> \> \> \> \> \> manufacturer: 'Apple Computer, Inc.'  
> \> \> \> \> \> \> product: 'Apple IR'  
> \> \> \> \> \> \> serialNumber: ''  
> \> \> \> \> \> \> locationID: 1.5624e+09  
> \> \> \> \> \> \> totalElements: 21  
> \> \> \> \> \> \> features: 0  
> \> \> \> \> \> \> inputs: 20  
> \> \> \> \> \> \> outputs: 0  
> \> \> \> \> \> \> collections: 1  
> \> \> \> \> \> \> axes: 0  
> \> \> \> \> \> \> buttons: 0  
> \> \> \> \> \> \> hats: 0  
> \> \> \> \> \> \> sliders: 0  
> \> \> \> \> \> \> dials: 0  
> \> \> \> \> \> \> wheels: 0  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Device(2)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> usagePageValue: 1  
> \> \> \> \> \> \> usageValue: 128  
> \> \> \> \> \> \> usageName: 'System Control'  
> \> \> \> \> \> \> index: 2  
> \> \> \> \> \> \> transport: 'USB'  
> \> \> \> \> \> \> vendorID: 2689  
> \> \> \> \> \> \> productID: 257  
> \> \> \> \> \> \> version: 272  
> \> \> \> \> \> \> manufacturer: 'CHESEN'  
> \> \> \> \> \> \> product: 'USB Keyboard'  
> \> \> \> \> \> \> serialNumber: ''  
> \> \> \> \> \> \> locationID: 1.0245e+09  
> \> \> \> \> \> \> totalElements: 29  
> \> \> \> \> \> \> features: 0  
> \> \> \> \> \> \> inputs: 27  
> \> \> \> \> \> \> outputs: 0  
> \> \> \> \> \> \> collections: 2  
> \> \> \> \> \> \> axes: 0  
> \> \> \> \> \> \> buttons: 0  
> \> \> \> \> \> \> hats: 0  
> \> \> \> \> \> \> sliders: 0  
> \> \> \> \> \> \> dials: 0  
> \> \> \> \> \> \> wheels: 0  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Device(3)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> usagePageValue: 1  
> \> \> \> \> \> \> usageValue: 6  
> \> \> \> \> \> \> usageName: 'Keyboard'  
> \> \> \> \> \> \> index: 3  
> \> \> \> \> \> \> transport: 'USB'  
> \> \> \> \> \> \> vendorID: 2689  
> \> \> \> \> \> \> productID: 257  
> \> \> \> \> \> \> version: 272  
> \> \> \> \> \> \> manufacturer: 'CHESEN'  
> \> \> \> \> \> \> product: 'USB Keyboard'  
> \> \> \> \> \> \> serialNumber: ''  
> \> \> \> \> \> \> locationID: 1.0245e+09  
> \> \> \> \> \> \> totalElements: 276  
> \> \> \> \> \> \> features: 0  
> \> \> \> \> \> \> inputs: 270  
> \> \> \> \> \> \> outputs: 5  
> \> \> \> \> \> \> collections: 1  
> \> \> \> \> \> \> axes: 0  
> \> \> \> \> \> \> buttons: 0  
> \> \> \> \> \> \> hats: 0  
> \> \> \> \> \> \> sliders: 0  
> \> \> \> \> \> \> dials: 0  
> \> \> \> \> \> \> wheels: 0  
> \> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Device(4)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> usagePageValue: 12  
> \> \> \> \> \> \> usageValue: 1  
> \> \> \> \> \> \> usageName: 'Consumer Usage 0x1'  
> \> \> \> \> \> \> index: 4  
> \> \> \> \> \> \> transport: 'USB'  
> \> \> \> \> \> \> vendorID: 1452  
> \> \> \> \> \> \> productID: 538  
> \> \> \> \> \> \> version: 19  
> \> \> \> \> \> \> manufacturer: 'Apple Computer'  
> \> \> \> \> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> \> \> \> \> serialNumber: ''  
> \> \> \> \> \> \> locationID: 488636416  
> \> \> \> \> \> \> totalElements: 2  
> \> \> \> \> \> \> features: 0  
> \> \> \> \> \> \> inputs: 1  
> \> \> \> \> \> \> outputs: 0  
> \> \> \> \> \> \> collections: 1  
> \> \> \> \> \> \> axes: 0  
> \> \> \> \> \> \> buttons: 0  
> \> \> \> \> \> \> hats: 0  
> \> \> \> \> \> \> sliders: 0  
> \> \> \> \> \> \> dials: 0  
> \> \> \> \> \> \> wheels: 0  
> \> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Device(5)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> usagePageValue: 1  
> \> \> \> \> \> \> usageValue: 2  
> \> \> \> \> \> \> usageName: 'Mouse'  
> \> \> \> \> \> \> index: 5  
> \> \> \> \> \> \> transport: 'USB'  
> \> \> \> \> \> \> vendorID: 1452  
> \> \> \> \> \> \> productID: 538  
> \> \> \> \> \> \> version: 0  
> \> \> \> \> \> \> manufacturer: 'Apple Computer'  
> \> \> \> \> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> \> \> \> \> serialNumber: '0'  
> \> \> \> \> \> \> locationID: 488636416  
> \> \> \> \> \> \> totalElements: 6  
> \> \> \> \> \> \> features: 0  
> \> \> \> \> \> \> inputs: 4  
> \> \> \> \> \> \> outputs: 0  
> \> \> \> \> \> \> collections: 2  
> \> \> \> \> \> \> axes: 2  
> \> \> \> \> \> \> buttons: 1  
> \> \> \> \> \> \> hats: 0  
> \> \> \> \> \> \> sliders: 0  
> \> \> \> \> \> \> dials: 0  
> \> \> \> \> \> \> wheels: 1  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Device(6)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> usagePageValue: 255  
> \> \> \> \> \> \> usageValue: 1  
> \> \> \> \> \> \> usageName: 'Page: 0xff, Usage: 0x1'  
> \> \> \> \> \> \> index: 6  
> \> \> \> \> \> \> transport: 'USB'  
> \> \> \> \> \> \> vendorID: 1452  
> \> \> \> \> \> \> productID: 538  
> \> \> \> \> \> \> version: 0  
> \> \> \> \> \> \> manufacturer: 'Apple'  
> \> \> \> \> \> \> product: 'Trackpad'  
> \> \> \> \> \> \> serialNumber: ''  
> \> \> \> \> \> \> locationID: 488636416  
> \> \> \> \> \> \> totalElements: 20  
> \> \> \> \> \> \> features: 17  
> \> \> \> \> \> \> inputs: 2  
> \> \> \> \> \> \> outputs: 0  
> \> \> \> \> \> \> collections: 1  
> \> \> \> \> \> \> axes: 0  
> \> \> \> \> \> \> buttons: 0  
> \> \> \> \> \> \> hats: 0  
> \> \> \> \> \> \> sliders: 0  
> \> \> \> \> \> \> dials: 0  
> \> \> \> \> \> \> wheels: 0  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Device(7)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> usagePageValue: 1  
> \> \> \> \> \> \> usageValue: 2  
> \> \> \> \> \> \> usageName: 'Mouse'  
> \> \> \> \> \> \> index: 7  
> \> \> \> \> \> \> transport: 'USB'  
> \> \> \> \> \> \> vendorID: 1452  
> \> \> \> \> \> \> productID: 538  
> \> \> \> \> \> \> version: 0  
> \> \> \> \> \> \> manufacturer: 'Apple'  
> \> \> \> \> \> \> product: 'Trackpad'  
> \> \> \> \> \> \> serialNumber: ''  
> \> \> \> \> \> \> locationID: 488636416  
> \> \> \> \> \> \> totalElements: 27  
> \> \> \> \> \> \> features: 17  
> \> \> \> \> \> \> inputs: 7  
> \> \> \> \> \> \> outputs: 0  
> \> \> \> \> \> \> collections: 3  
> \> \> \> \> \> \> axes: 2  
> \> \> \> \> \> \> buttons: 3  
> \> \> \> \> \> \> hats: 0  
> \> \> \> \> \> \> sliders: 0  
> \> \> \> \> \> \> dials: 0  
> \> \> \> \> \> \> wheels: 0  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Device(8)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> usagePageValue: 1  
> \> \> \> \> \> \> usageValue: 6  
> \> \> \> \> \> \> usageName: 'Keyboard'  
> \> \> \> \> \> \> index: 8  
> \> \> \> \> \> \> transport: 'USB'  
> \> \> \> \> \> \> vendorID: 1452  
> \> \> \> \> \> \> productID: 538  
> \> \> \> \> \> \> version: 19  
> \> \> \> \> \> \> manufacturer: 'Apple Computer'  
> \> \> \> \> \> \> product: 'Apple Internal Keyboard / Trackpad'  
> \> \> \> \> \> \> serialNumber: ''  
> \> \> \> \> \> \> locationID: 488636416  
> \> \> \> \> \> \> totalElements: 244  
> \> \> \> \> \> \> features: 0  
> \> \> \> \> \> \> inputs: 238  
> \> \> \> \> \> \> outputs: 5  
> \> \> \> \> \> \> collections: 1  
> \> \> \> \> \> \> axes: 0  
> \> \> \> \> \> \> buttons: 0  
> \> \> \> \> \> \> hats: 0  
> \> \> \> \> \> \> sliders: 0  
> \> \> \> \> \> \> dials: 0  
> \> \> \> \> \> \> wheels: 0  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> --------------- end output -----------------------------------  
> \> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> Reg. Sync failures: If you open your window by providing a  
> \> \> \> \> \> \> \> rect parameter of e.g., [0 0 640 480], so it only covers

part  

> \> \> \> \> \> \> \> of the screen, yes, you may get more sync failures and a  
> \> \> \> \> \> \> \> generally unusable timing for real work. This mode is ok  
> \> \> \> \> \> \> \> for debugging your script etc., but not for timing tests or  
> \> \> \> \> \> \> \> real data collection. The OS/X Quartz window manager  
> \> \> \> \> \> \> \> interferes with presentation timing and timestamping in  
> \> \> \> \> \> \> \> windowed mode, and probably even more so on a weak  
> \> \> \> \> \> \> \> GMA-950. But even with high-end graphics you wouldn't  
> \> \> \> \> \> \> \> get good enough timing. Just use the 'SkipSyncTests' setting  
> \> \> \> \> \> \> \> during development/debugging of your script and remove  
> \> \> \> \> \> \> \> it for real data collection.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> -mario  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "andyleb"

\<andyleb@\> wrote:  

> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> \> Hi Mario,  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Thanks so much for replying. At the time I posted, I

was running  

> \> \> \> \> \> \> \> \> PTB3's \*very\* latest beta, with matlab2006a (7.4).

Since then, I've  

> \> \> \> \> \> \> \> \> upgraded to matlab2006b (7.5) and reinstalled

PTB3-beta. I also  

> \> \> \> \> \> \> \> \> updated to the most recent version of quicktime.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> 1. Sync failures. I realized that it's much more

likely to occur  

> \> \> \> \> \> \> \> \> when my main window is smaller than the full size of

my display (e.g.,  

> \> \> \> \> \> \> \> \> 640x480 in a 1280x800 screen). Did I wrongly assume

we can open small  

> \> \> \> \> \> \> \> \> windows in OS X without syncing trouble? The output

is pasted into  

> \> \> \> \> \> \> \> \> this message (please scroll down).  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> 2. USB device trouble. Since upgrading, I haven't

had this problem  

> \> \> \> \> \> \> \> \> at all. Maybe I just had a buggy install of matlab 2006a?  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> 3. I'm still looking into the Char problems on the

various windows  

> \> \> \> \> \> \> \> \> machines, based on your recommendations. I'll post on

those  

> \> \> \> \> \> \> \> \> separately. I'd also like to hear if anyone else has

experienced  

> \> \> \> \> \> \> \> \> these problems.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Thanks so much for your help!!  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Andy  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> -------- SYNC FAILURE OUTPUT   
> \> \> --------------------------------------  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> PTB-INFO: This is the OpenGL-Psychtoolbox version

3.0.8. Type  

> \> \> \> \> \> \> \> \> 'PsychtoolboxVersion' for more detailed version

information.  

> \> \> \> \> \> \> \> \> PTB-INFO: Psychtoolbox is licensed to you under terms

of the GNU  

> \> \> \> \> \> \> \> \> General Public License (GPL). See file 'License.txt'

in the  

> \> \> \> \> \> \> \> \> PTB-INFO: Psychtoolbox root folder for a copy of the

GPL license.  

> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> OpenGL-Extensions are: GL\_ARB\_transpose\_matrix   
> \> GL\_ARB\_vertex\_program  
> \> \> \> \> \> \> \> \> GL\_ARB\_vertex\_blend GL\_ARB\_window\_pos

GL\_ARB\_shader\_objects  

> \> \> \> \> \> \> \> \> GL\_ARB\_vertex\_shader GL\_EXT\_multi\_draw\_arrays   
> \> GL\_EXT\_clip\_volume\_hint  
> \> \> \> \> \> \> \> \> GL\_EXT\_rescale\_normal GL\_EXT\_draw\_range\_elements

GL\_EXT\_fog\_coord  

> \> \> \> \> \> \> \> \> GL\_EXT\_gpu\_program\_parameters GL\_APPLE\_client\_storage  
> \> \> \> \> \> \> \> \> GL\_APPLE\_specular\_vector GL\_APPLE\_transform\_hint  
> \> \> \> \> \> \> \> \> GL\_APPLE\_packed\_pixels GL\_APPLE\_fence

GL\_APPLE\_vertex\_array\_object  

> \> \> \> \> \> \> \> \> GL\_APPLE\_vertex\_program\_evaluators GL\_APPLE\_element\_array  
> \> \> \> \> \> \> \> \> GL\_APPLE\_flush\_render GL\_NV\_texgen\_reflection   
> \> GL\_NV\_light\_max\_exponent  
> \> \> \> \> \> \> \> \> GL\_IBM\_rasterpos\_clip GL\_SGIS\_generate\_mipmap  
> \> \> \> \> \> \> \> \> GL\_ARB\_shading\_language\_100 GL\_ARB\_texture\_border\_clamp  
> \> \> \> \> \> \> \> \> GL\_ARB\_multitexture GL\_ARB\_texture\_env\_add

GL\_ARB\_texture\_cube\_map  

> \> \> \> \> \> \> \> \> GL\_ARB\_texture\_env\_dot3 GL\_ARB\_texture\_env\_combine  
> \> \> \> \> \> \> \> \> GL\_ARB\_texture\_compression GL\_ARB\_texture\_mirrored\_repeat  
> \> \> \> \> \> \> \> \> GL\_ARB\_shadow GL\_ARB\_depth\_texture GL\_ARB\_fragment\_program  
> \> \> \> \> \> \> \> \> GL\_ARB\_fragment\_shader GL\_ARB\_point\_sprite  
> \> \> \> \> \> \> \> \> GL\_ARB\_texture\_non\_power\_of\_two

GL\_ARB\_vertex\_buffer\_object  

> \> \> \> \> \> \> \> \> GL\_ARB\_pixel\_buffer\_object GL\_EXT\_framebuffer\_object  
> \> \> \> \> \> \> \> \> GL\_EXT\_texture\_rectangle GL\_ARB\_texture\_rectangle  
> \> \> \> \> \> \> \> \> GL\_EXT\_texture\_env\_add GL\_EXT\_blend\_color

GL\_EXT\_blend\_minmax  

> \> \> \> \> \> \> \> \> GL\_EXT\_blend\_subtract GL\_EXT\_texture\_lod\_bias GL\_EXT\_abgr   
> \> GL\_EXT\_bgra  
> \> \> \> \> \> \> \> \> GL\_EXT\_stencil\_wrap GL\_EXT\_texture\_filter\_anisotropic  
> \> \> \> \> \> \> \> \> GL\_EXT\_separate\_specular\_color GL\_EXT\_secondary\_color  
> \> \> \> \> \> \> \> \> GL\_EXT\_blend\_func\_separate GL\_EXT\_shadow\_funcs   
> \> GL\_EXT\_stencil\_two\_side  
> \> \> \> \> \> \> \> \> GL\_EXT\_texture\_compression\_s3tc

GL\_EXT\_texture\_compression\_dxt1  

> \> \> \> \> \> \> \> \> GL\_EXT\_blend\_equation\_separate GL\_EXT\_packed\_depth\_stencil  
> \> \> \> \> \> \> \> \> GL\_APPLE\_flush\_buffer\_range GL\_APPLE\_ycbcr\_422   
> \> GL\_APPLE\_texture\_range  
> \> \> \> \> \> \> \> \> GL\_APPLE\_pixel\_buffer GL\_NV\_blend\_square

GL\_ATI\_texture\_env\_combine3  

> \> \> \> \> \> \> \> \> GL\_SGIS\_texture\_edge\_clamp GL\_SGIS\_texture\_lod   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> PTB-INFO: OpenGL-Renderer is Intel Inc. :: Intel GMA

950 OpenGL Engine  

> \> \> \> \> \> \> \> \> :: 1.2 APPLE-1.4.56  
> \> \> \> \> \> \> \> \> PTB-INFO: Renderer has 64 MB of VRAM and a maximum 64

MB of texture  

> \> \> \> \> \> \> \> \> memory.  
> \> \> \> \> \> \> \> \> PTB-Info: VBL startline = 800 , VBL Endline = -1  
> \> \> \> \> \> \> \> \> PTB-Info: Beamposition queries unsupported on this

system. Will try to  

> \> \> \> \> \> \> \> \> use kernel-level vbl interrupts as fallback.  
> \> \> \> \> \> \> \> \> PTB-Info: Measured monitor refresh interval from

VBLsync = 17.356896  

> \> \> \> \> \> \> \> \> ms [57.613989 Hz]. (57 valid samples taken,

stddev=3.102240 ms.)  

> \> \> \> \> \> \> \> \> PTB-Info: Small deviations between reported values are

normal and no  

> \> \> \> \> \> \> \> \> reason to worry.  
> \> \> \> \> \> \> \> \> PTB-INFO: Using OpenGL GL\_TEXTURE\_RECTANGLE\_EXT

extension for  

> \> \> \> \> \> \> \> \> efficient high-performance texture mapping...  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> WARNING: Couldn't compute a reliable estimate of

monitor refresh  

> \> \> \> \> \> \> \> \> interval! Trouble with VBL syncing?!?  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> ----- ! PTB - ERROR: SYNCHRONIZATION FAILURE ! ----  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> One or more internal checks (see Warnings above)

indicate that  

> \> \> \> \> \> \> \> \> synchronization  
> \> \> \> \> \> \> \> \> of Psychtoolbox to the vertical retrace (VBL) is not

working on your  

> \> \> \> \> \> \> \> \> setup.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> This will seriously impair proper stimulus

presentation and stimulus  

> \> \> \> \> \> \> \> \> presentation timing!  
> \> \> \> \> \> \> \> \> Please read 'help SyncTrouble' for information about

how to solve or  

> \> \> \> \> \> \> \> \> work-around the problem.  
> \> \> \> \> \> \> \> \> You can force Psychtoolbox to continue, despite the

severe problems,  

> \> \> \> \> \> \> \> \> by adding the command  
> \> \> \> \> \> \> \> \> Screen('Preference', 'SkipSyncTests',1); at the top of

your script, if  

> \> \> \> \> \> \> \> \> you really know what you are doing.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> -------- END OUTPUT --------------------------------------  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "andyleb"

\<andyleb@\> wrote:  

> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> \> 1. On my MacBook (regular, not MacBook Pro), the

screen test  

> \> \> \> \> \> \> \> \> \> \> routinely fails. I understand the onboard

graphics card is pretty  

> \> \> \> \> \> \> \> \> \> \> weak for this computer, but is it bad enough that

the PTB Screen   

> \> \> \> \> \> \> \> \> \> \> can't work without skipping the sync test?  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> Strange, worked on MacBook/IntelGMA when i tested it

last time.  

> \> \> \> \> \> \> \> \> \> Provide PTB's Matlab output of the failure. I assume

you run the  

> \> \> \> \> \> \> \> \> \> \*very latest\* 'beta'?  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> You can always either completely skip the test or

tell PTB to go  

> \> \> \> \> \> \> \> \> \> on in case of failure, you'll just lose our normally

super-exact  

> \> \> \> \> \> \> \> \> \> timing if you do so -- or something else screws up

if there was  

> \> \> \> \> \> \> \> \> \> a good severe reason for the sync-failure of course

and not  

> \> \> \> \> \> \> \> \> \> only a noisy system.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> See:

\<[http://psychtoolbox.org/wikka.php?wakka=FaqWarningPrefs](http://psychtoolbox.org/wikka.php?wakka=FaqWarningPrefs)\>  

> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> or simply the help texts that PTB outputs in case of

failure. I  

> \> \> \> \> \> \> assume  
> \> \> \> \> \> \> \> \> \> you read them?  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> \> 2. Kb commands don't accept any input on my Mac

when a USB input  

> \> \> \> \> \> \> \> \> \> \> device is connected. That is, when a keyboard or

mouse are  

> \> \> \> \> \> \> connected,  
> \> \> \> \> \> \> \> \> \> \> even the laptop's built-in keyboard is not

recognized. Note  

> \> \> \> \> \> \> that this  
> \> \> \> \> \> \> \> \> \> \> only applies to Kb commands, as Char commands

(e.g., GetChar)  

> \> \> \> \> \> \> still  
> \> \> \> \> \> \> \> \> \> \> works fine. Is this an issue with PsychHID?  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> Also strange. I work all the time with a USB mouse

connected and  

> \> \> \> \> \> \> \> \> \> we never heard of or experienced an issue like that.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> What is the output of "GetKeyboardIndices" in that

case? What does  

> \> \> \> \> \> \> \> \> \> d=PsychHID('GetDevices') report? I mean of course

the full content  

> \> \> \> \> \> \> \> \> \> of 'd' d(1), d(2), ....  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> \> 3. For windows, I've been having some trouble

with the char  

> \> \> \> \> \> \> functions  
> \> \> \> \> \> \> \> \> \> \> (GetChar, ListenChar). I've seen this on 3

separate machines (two  

> \> \> \> \> \> \> \> \> \> \> using XP, one using 2000). Problems that occur are  
> \> \> \> \> \> \> idiosyncratic to  
> \> \> \> \> \> \> \> \> \> \> each machine, though. For instance, on one

machine, after calling  

> \> \> \> \> \> \> \> \> \> \> GetChar or ListenChar, the Windows menubar becomes

visible on the  

> \> \> \> \> \> \> \> \> \> \> bottom of the screen. On another machine, the

Flip command stops  

> \> \> \> \> \> \> \> \> \> \> working normally; that is, when I specify the

[dontclear]  

> \> \> \> \> \> \> parameter as  
> \> \> \> \> \> \> \> \> \> \> 1, the setting is ignored and the Flip command

behaves as if I had  

> \> \> \> \> \> \> \> \> \> \> specified "2" (i.e., the backbuffer simply

exchanges with the  

> \> \> \> \> \> \> front  
> \> \> \> \> \> \> \> \> \> \> buffer). To trigger this, I just need to add a

Char command  

> \> \> \> \> \> \> anywhere  
> \> \> \> \> \> \> \> \> \> \> before a Flip command.   
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> Anybody else ever seen this? Which Matlab version is

this? What  

> \> \> \> \> \> \> \> \> \> graphics card? Up to date drivers installed?  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> There is no direct connection between 'Flip' and

GetChar etc. but  

> \> \> \> \> \> \> \> \> \> you never know how Java's GetChar handling interacts

with Matlabs  

> \> \> \> \> \> \> \> \> \> desktop UI and that with desktop manager gimmicks of the  
> \> \> \> \> \> \> \> \> \> graphics driver -- Windows is a mess.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> But the 'dontclear' setting 1 doesn't work on many

Windows graphics  

> \> \> \> \> \> \> \> \> \> cards due to lack of features in the graphics

drivers. If you have  

> \> \> \> \> \> \> \> \> \> recent graphics hardware and need that feature, then its  
> \> \> \> \> \> \> \> \> \> a good idea to enable the imaging pipeline by

setting the  

> \> \> \> \> \> \> \> \> \> optional 'imagingMode' flag of Screen('OpenWindow',

...) to  

> \> \> \> \> \> \> \> \> \> kPsychNeedFastBackingStore.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> best,  
> \> \> \> \> \> \> \> \> \> -mario  
> \> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \>  
> \> \> \> \> \> \>  
> \> \> \> \> \>  
> \> \> \> \>  
> \> \> \>  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [March 5, 2009, 9:10pm UTC](https://psychtoolbox.discourse.group/t/macbook-synchronization-failure-kb-issues-getchar-issues/1265/6 "2009-03-05T21:10:08Z")

</div>

Hey,  
  

> \> I have seen the Windows XP taskbar pop up frequently, but not  
> \> necessarily related to the GetChar class of functions. I solved it by  
> \> setting the taskbar to NOT be on top of other windows (right-click on  
> \> the taskbar and select the Properties command; make sure "Keep the  
> \> taskbar on top of other windows is not checked). I haven't had the  
> \> taskbar appear since.

That does seem to have solved the problem. Thank you very much!  
  
Ta,  
Andrew
