# Problem using keyboard

**URL:** <https://discourse.psychopy.org/t/problem-using-keyboard/11692>\
**Category:** Coding\
**Created:** [March 24, 2020, 10:20am UTC](https://discourse.psychopy.org/t/problem-using-keyboard/11692 "2020-03-24T10:20:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![thibault](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@thibault](https://discourse.psychopy.org/u/thibault)\
**Post date:** [March 24, 2020, 10:20am UTC](https://discourse.psychopy.org/t/problem-using-keyboard/11692/1 "2020-03-24T10:20:08Z")

</div>

Hi erverybody,

i’m using psychopy with the following configuration:

- mac, Catalina
- emacs as python editor
- python 3.7

I encounter problems when trying to access the keyboard. It is a bit inconsistant, but these days i cannot even anymore load keyboard. I get the following error:

#####################################  
HIDBuildMultiDeviceList: Couldn’t open IOHIDManager.PsychHID-ERROR: Could not enumerate and attach to all HID devices (HIDBuildDeviceList(0,0) failed)!  
PsychHID-ERROR: One reason could be that some HID devices are already exclusively claimed by some 3rd party device drivers  
PsychHID-ERROR: or applications. I will now retry to only claim control of a hopefully safe subset of devices like standard  
PsychHID-ERROR: keyboards, mice, gamepads and supported USB-DAQ devices and other vendor defined devices and hope this goes better…  
PsychHID-INFO: That worked. A subset of regular mouse, keyboard etc. input devices and maybe some vendor defined devices will be available at least.

Process Python illegal instruction: 4  
#####################################

I’m really confused, and any help would be greatly appreciated,  
rergards,  
thibault

---

<div class="post-metadata">

**Author:** ![jonathan.kominsky](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jonathan.kominsky](https://discourse.psychopy.org/u/jonathan.kominsky)\
**Post date:** [March 24, 2020, 4:45pm UTC](https://discourse.psychopy.org/t/problem-using-keyboard/11692/2 "2020-03-24T16:45:32Z")

</div>

I’m betting this is Catalina. Does PsychoPy (or the Python instance you are using) have “accessibility permissions” in the security settings?

Also, are you using the standalone version or just running your experiment from terminal?

---

<div class="post-metadata">

**Author:** ![thibault](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@thibault](https://discourse.psychopy.org/u/thibault)\
**Post date:** [March 24, 2020, 5:27pm UTC](https://discourse.psychopy.org/t/problem-using-keyboard/11692/3 "2020-03-24T17:27:25Z")

</div>

Dear Jonathan,

this is also my bet. But i’ve no idea how to solve it.  
I run Python from emacs (and tried also directly from terminal, with the same error). I checked that python, terminal, psychopy have access to “input monitoring” in the security center, but apprently this is not enough… I think this is a problem of permission, though.

Using the standalone version, keyboard does work, but i cannot use the microphone, because i cannot load pyo from the standalone version (“image not found” message) : [Pyo not found with catalina (mac)](https://discourse.psychopy.org/t/pyo-not-found-with-catalina-mac/11691/2)

Best  
thibault  
thibault

---

<div class="post-metadata">

**Author:** ![jonathan.kominsky](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jonathan.kominsky](https://discourse.psychopy.org/u/jonathan.kominsky)\
**Post date:** [March 24, 2020, 5:32pm UTC](https://discourse.psychopy.org/t/problem-using-keyboard/11692/4 "2020-03-24T17:32:37Z")

</div>

I feel entirely justified sticking with High Sierra right now.

When you run it from the terminal, and this is a wild shot in the dark, do you use a sudo command?

---

<div class="post-metadata">

**Author:** ![rosem09](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/rosem09/32/11349_2.png) [@rosem09](https://discourse.psychopy.org/u/rosem09)\
**Post date:** [March 24, 2020, 5:42pm UTC](https://discourse.psychopy.org/t/problem-using-keyboard/11692/5 "2020-03-24T17:42:45Z")

</div>

I have the same problem in Mojave with pyo on the newest version of Psychopy…

---

<div class="post-metadata">

**Author:** ![thibault](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@thibault](https://discourse.psychopy.org/u/thibault)\
**Post date:** [March 24, 2020, 6:02pm UTC](https://discourse.psychopy.org/t/problem-using-keyboard/11692/6 "2020-03-24T18:02:55Z")

</div>

This does not change the result. Precisely, i then get: zsh: illegal hardware instruction

Looking into the report, i see:

Termination Signal: Illegal instruction: 4

Termination Reason: Namespace SIGNAL, Code 0x4

Terminating Process: exc handler [2645]

Application Specific Information:

BUG IN CLIENT OF LIBDISPATCH: dispatch\_sync called on queue already owned by current thread

By the way, trying to launch the microphone from the terminal also give me an (a priori unrelated, but who knows…) error:

from psychopy.sound import backend\_pyo

File “/usr/local/lib/python3.7/site-packages/psychopy/sound/ **init**.py”, line 157, in

```
elif dev not in backend.getDevices(kind='output'):

```

File “/usr/local/lib/python3.7/site-packages/psychopy/sound/backend\_pyo.py”, line 135, in getDevices

```
inputs, outputs = get_devices_infos()

```

File “/usr/local/lib/python3.7/site-packages/psychopy/sound/backend\_pyo.py”, line 93, in get\_devices\_infos

```
devices = _query_devices()

```

File “/usr/local/lib/python3.7/site-packages/psychopy/sound/backend\_pyo.py”, line 86, in \_query\_devices

```
info[v.strip().split(": ")[0]] = v.strip().split(": ")[1]

```

IndexError: list index out of range

I’m somewhat confused….

Best

thibault

---

<div class="post-metadata">

**Author:** ![jonathan.kominsky](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jonathan.kominsky](https://discourse.psychopy.org/u/jonathan.kominsky)\
**Post date:** [March 29, 2020, 5:33pm UTC](https://discourse.psychopy.org/t/problem-using-keyboard/11692/7 "2020-03-29T17:33:16Z")

</div>

Yeah, I think this is Pyo and Catalina not getting along. I’m afraid I have no idea how to fix it. I know sounddevice doesn’t have microphone implementation, I’m not sure whether the new PTB library does or not.
