# deviceNumber workaround in Windows

**URL:** <https://psychtoolbox.discourse.group/t/devicenumber-workaround-in-windows/3312>\
**Category:** Programming Help\
**Created:** [July 29, 2020, 6:43pm UTC](https://psychtoolbox.discourse.group/t/devicenumber-workaround-in-windows/3312 "2020-07-29T18:43:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gchandra](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@gchandra](https://psychtoolbox.discourse.group/u/gchandra)\
**Post date:** [July 29, 2020, 6:43pm UTC](https://psychtoolbox.discourse.group/t/devicenumber-workaround-in-windows/3312/1 "2020-07-29T18:43:22Z")

</div>

Hello,

As mentioned in the PTB documentation, Psychtoolbox does not appear to be able to distinguish between different keyboards when using functions like kbWait, kbCheck, for Windows like it can for Linux. Is there any kind of workaround for this in Windows where, if I have the laptop keyboard and external keyboard both as keyboard devices, I can listen to inputs from only one of the with kbWait?

I’m running this on a Windows 10 machine with PTB Version 3.0.16 and MATLAB version 2019b.

Thanks in advance for any help!

---

<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:** [August 3, 2020, 2:03pm UTC](https://psychtoolbox.discourse.group/t/devicenumber-workaround-in-windows/3312/2 "2020-08-03T14:03:51Z")

</div>

No, there isn’t any workaround to my knowledge.  
-mario

---

<div class="post-metadata">

**Author:** ![gchandra](https://avatars.discourse-cdn.com/v4/letter/g/4da419/32.png) [@gchandra](https://psychtoolbox.discourse.group/u/gchandra)\
**Post date:** [August 3, 2020, 2:20pm UTC](https://psychtoolbox.discourse.group/t/devicenumber-workaround-in-windows/3312/3 "2020-08-03T14:20:57Z")

</div>

Ok, thanks!  
I’m curious why this isn’t possible in Windows but can be done in Linux?

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [August 3, 2020, 3:51pm UTC](https://psychtoolbox.discourse.group/t/devicenumber-workaround-in-windows/3312/4 "2020-08-03T15:51:51Z")

</div>

Limits in Windows design. Consider dual booting your machine to Linux, so you can do what you need without causing trouble for others

---

<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:** [August 3, 2020, 3:52pm UTC](https://psychtoolbox.discourse.group/t/devicenumber-workaround-in-windows/3312/5 "2020-08-03T15:52:35Z")

</div>

Because Linux is a superior operating system if you need reliability, performance, accuracy and flexibility for more unusual use cases. It was easy and painless enough to implement it. On Windows, this is painful.

There is one theoretical approach how one could try to get this functionality, discussed here:

> <https://github.com/Psychtoolbox-3/Psychtoolbox-3/issues/433>
>
> Hi Mario,
> I had been researching how to best access input from keyboards, and found that with raw input, you can distinguish...

Note the lack of any progress since the proposal in over three years though.

However, due to additional constraints and obstacles imposed on us by Matlab, Octave (or likely Python, in case of PsychHID for Python) it doesn’t have a great a priori chance of success and would require a substantial redesign of our Windows input handling to even try – and probably fail.

If you wanted to spend a few ten-thousand Euros to finance a couple of hundred work hours for me to try implementing it sometime next year, with no guarantee of success, your money is welcome. Otherwise the fastest and cheapest answer to high quality and more pain free neuroscience data collection is almost always “Upgrade to Linux”.
