Changes

Jump to navigation Jump to search
72 bytes added ,  15:55, 3 July 2020
Line 12: Line 12:     
== Das Keyboard 4Q ==
 
== Das Keyboard 4Q ==
The Das keyboard allows far more advanced programming of keys. The photo on the right shows how the Das Keyboard can be programmed to react to the key mapping of the experiment. Some participants are instructed to press the ''E'' key for a green stimulus and the ''I'' key for a blue stimulus. For other participants it is the other way around. These instructions are shown at the start of the experiment. The keyboard backlights are used as a constant reminder of the instructions.
+
The Das Keyboard allows far more advanced programming of keys. The photo on the right shows how the Das Keyboard can be programmed to react to the key mapping of the experiment. Some participants are instructed to press the ''E'' key for a green stimulus and the ''I'' key for a blue stimulus. For other participants it is the other way around. These instructions are shown at the start of the experiment. The keyboard backlights are used as a constant reminder of the instructions.
 
[[File:Das Keyboard Simon Task.png|thumb|Das Keyboard backlight reacting to the counterbalanced key mapping of a Simon experiment.]]
 
[[File:Das Keyboard Simon Task.png|thumb|Das Keyboard backlight reacting to the counterbalanced key mapping of a Simon experiment.]]
    
If you want to borrow the Das Keyboard 4Q, please contact the Technical Support Group. Please note that the Das Keyboard Q software must be installed on a computer for the keyboard backlights to work.
 
If you want to borrow the Das Keyboard 4Q, please contact the Technical Support Group. Please note that the Das Keyboard Q software must be installed on a computer for the keyboard backlights to work.
   −
[https://www.daskeyboard.io/get-started/ Detailed information] about programming the Das Keyboard 4Q can be found on the manufacturer website. A few exmples are given below.
+
[https://www.daskeyboard.io/get-started/ Detailed information] about programming the Das Keyboard 4Q can be found on the manufacturer website. A few examples are given below.
   −
=== Setting key backlights from Python ===
+
=== Setting key backlights from Python, the easy way ===
 +
If you find this too complicated, you can use the daskeyboard [https://gitlab.socsci.ru.nl/wilberth/daskeyboard Python library]. Just put the file [https://gitlab.socsci.ru.nl/wilberth/daskeyboard/-/raw/master/daskeyboard.py?inline=false daskeyboard.py] in the same directory as the experiment and use:
 +
<source lang="python">
 +
import daskeyboard
 +
 
 +
daskeyboard.keyColor("g", "blue") # G key becomes blue
 +
</source>
 +
 
 +
=== Setting key backlights from Python, the hard way ===
 
<source lang="python">
 
<source lang="python">
 
#!/usr/bin/env python3  
 
#!/usr/bin/env python3  
Line 48: Line 56:  
else:
 
else:
 
print("Error: " + result.text)
 
print("Error: " + result.text)
</source>
  −
  −
If you find this too complicated, you can use the daskeyboard [https://gitlab.socsci.ru.nl/wilberth/daskeyboard Python library]. Just put the file [https://gitlab.socsci.ru.nl/wilberth/daskeyboard/-/raw/master/daskeyboard.py?inline=false daskeyboard.py] in the same directory as the experiment and use:
  −
<source lang="python">
  −
import daskeyboard
  −
  −
daskeyboard.keyColor("g", "blue") # G key becomes blue
   
</source>
 
</source>

Navigation menu