Hello,
URL of experiment: https://run.pavlovia.org/jens.boelte/changeblindnessexp3/html
gitlab link: https://gitlab.pavlovia.org/jens.boelte/changeblindnessexp3
Description of the problem:
While PsychoPy recognizes a non-english keyboard layout and the non-English keys, for instance Umlauts, äÄ, öÖ, üÜ, but also ß, Pavlovia does not. On Pavolvia I get the letters/signs an English keyboard layout has isntead when punishing these keys. I use the following code to get a typed response.
var _pj;
function _pj_snippets(container) {
function in_es6(left, right) {
if (((right instanceof Array) || ((typeof right) === "string"))) {
return (right.indexOf(left) > (- 1));
} else {
if (((right instanceof Map) || (right instanceof Set) || (right instanceof WeakMap) || (right instanceof WeakSet))) {
return right.has(left);
} else {
return (left in right);
}
}
}
container["in_es6"] = in_es6;
return container;
}
_pj = {};
_pj_snippets(_pj);
actualKeys = event.getKeys();
n = actualKeys.length;
i = 0;
while ((i < n)) {
if ((actualKeys[i] === "return")) {
continueRoutine = false;
break;
} else {
if ((actualKeys[i] === "backspace")) {
inputText = inputText.slice(0, (- 1));
i = (i + 1);
} else {
if ((actualKeys[i] === "space")) {
inputText += " ";
i = (i + 1);
} else {
if (_pj.in_es6(actualKeys[i], ["minus", "-", "num_subtract", "Minus", "slash"])) {
inputText += "-";
i = (i + 1);
} else {
if (_pj.in_es6(actualKeys[i], ["lshift", "rshift", "SHIFT"])) {
shift_flag = true;
i = (i + 1);
} else {
if ((actualKeys[i].length === 1)) {
if (shift_flag) {
inputText += actualKeys[i].toUpperCase();
shift_flag = false;
} else {
inputText += actualKeys[i];
}
}
i = (i + 1);
}
}
}
}
}
}
It would be really cool if the keyboard layout used on the computer would be used. How do I achieve that?
Best wishes Jens