<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://tsgdoc.socsci.ru.nl/index.php?action=history&amp;feed=atom&amp;title=Das_Keyboard_4Q</id>
	<title>Das Keyboard 4Q - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://tsgdoc.socsci.ru.nl/index.php?action=history&amp;feed=atom&amp;title=Das_Keyboard_4Q"/>
	<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Das_Keyboard_4Q&amp;action=history"/>
	<updated>2026-06-21T11:35:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Das_Keyboard_4Q&amp;diff=6200&amp;oldid=prev</id>
		<title>E.vandenberge: Created page with &quot;&lt;!-- Table of Contents will be generated here --&gt;  ==Backlight Programming==  The Das Keyboard allows for more advanced programming of keys. The photo on the right shows how t...&quot;</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Das_Keyboard_4Q&amp;diff=6200&amp;oldid=prev"/>
		<updated>2026-02-03T12:39:07Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;!-- Table of Contents will be generated here --&amp;gt;  ==Backlight Programming==  The Das Keyboard allows for more advanced programming of keys. The photo on the right shows how t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Table of Contents will be generated here --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Backlight Programming==&lt;br /&gt;
&lt;br /&gt;
The Das Keyboard allows for 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.&lt;br /&gt;
[[File:Das Keyboard Simon Task.png|thumb|Das Keyboard backlight reacting to the counterbalanced key mapping of a Simon experiment.]]&lt;br /&gt;
&lt;br /&gt;
If you want to borrow the Das Keyboard 4Q, please contact the Technical Support Group. Please note that the [https://www.daskeyboard.io/get-started/software/ Das Keyboard Q software] must be installed on a computer for the keyboard backlights to work.&lt;br /&gt;
&lt;br /&gt;
[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.&lt;br /&gt;
&lt;br /&gt;
=== Setting key backlights from Python, the easy way ===&lt;br /&gt;
The easiest way is to 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:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import daskeyboard&lt;br /&gt;
&lt;br /&gt;
daskeyboard.keyColor(&amp;quot;g&amp;quot;, &amp;quot;blue&amp;quot;) # G key becomes blue&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting key backlights from Python, the hard way ===&lt;br /&gt;
What is done below the hood is that your python code calls a restful deamon that controls the keyboard:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3 &lt;br /&gt;
&lt;br /&gt;
url = 'http://localhost:27301'&lt;br /&gt;
&lt;br /&gt;
headers = { &amp;quot;Content-type&amp;quot;: &amp;quot;application/json&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
import json&lt;br /&gt;
import requests&lt;br /&gt;
&lt;br /&gt;
# prepare signal&lt;br /&gt;
signal = {&lt;br /&gt;
	'zoneId': 'KEY_Q',&lt;br /&gt;
	'color': '#F0F',&lt;br /&gt;
	'effect': 'SET_COLOR',&lt;br /&gt;
	'pid': 'DK4QPID',&lt;br /&gt;
	'name': 'Set Q to purple'&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# send signal&lt;br /&gt;
result = requests.post(url + '/api/1.0/signals', data=json.dumps(signal), headers=headers)&lt;br /&gt;
&lt;br /&gt;
# checking the response&lt;br /&gt;
if result.ok:&lt;br /&gt;
	print(&amp;quot;OK&amp;quot;)&lt;br /&gt;
	print(result.text)&lt;br /&gt;
else:&lt;br /&gt;
	print(&amp;quot;Error: &amp;quot; + result.text)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also== &amp;lt;!-- Optional --&amp;gt;&lt;br /&gt;
*[[Keyboards]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--==References== &amp;lt;!-- Optional --&amp;gt;&lt;br /&gt;
&amp;lt;references /&amp;gt; &amp;lt;!-- Automatically generates list of references using the &amp;lt;ref&amp;gt;&amp;lt;/ref&amp;gt; tags. --&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
</feed>