Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Change keyboard layout in item text_input

edited January 2014 in OpenSesame

Hi there,
i am using an text_input item, default system language is german.
The question is printed correct (in the sense of german keyboard layout), with characters like ":" and umlaute like "ä". But in the response field, the input is formatted in english keyboard layout, with "z" instead of "y" , ";" instead of "ö" and so on.
Is there a way to change that?
Cheers and Thanks,
Björn

Comments

  • edited 4:21PM

    Hi Björn,

    Right, I'm in Marseille at the moment, and I noticed the same thing with the azerty keyboards. I filed a bug on this: https://github.com/smathot/OpenSesame/issues/86

    The pyscho backend should take your keyboard layout into account. But since the text_input plug-in isn't compatible with the psycho backend at the moment, you'll need a little inline script. You will probably find the code posted in this discussion useful: http://forum.cogsci.nl/index.php?p=/discussion/31/solved-multi-character-keyboard-response-or-simultaneous-sketchpad-and-text_input/p1

    Cheers!
    Sebastiaan

  • edited 4:21PM

    Hey Sebastiaan,

    thank your very much for your response! Unfortunately neither PsychoPy nor the inline code snippet will help me. The inline code snippet indeed is working fine, but i am sorry to say that is not what i was looking for. I am forced to use the legacy backend, since i am also presenting video files with the media player plugin.

    I need to find a way to enable german/Germany keyboard layout inside of the text_input item, because at the moment pressing "z" returns "y", "ö" returns "[" and so on. That is destracting the participants and produces unreadable data ;-)
    Cheers to Marseille from Konstanz! Björn

  • edited 4:21PM

    Right, I see. I can't think of a specific workaround at the moment, but perhaps these pointers could help you a bit with finding a solution yourself.

    Essentially, you will need to find a function that replaces this (from the script linked above):

    resp += my_keyboard.to_chr(key)

    key is a numeric variable that corresponds to the key that is pressed. resp should respond to the equivalent character. But it assumes a Qwerty mapping, so it goes wrong for you. I'm confident that you will be able to find a Python function/ module somewhere that makes an adequate the key → resp translation for different keyboard layouts.

    For more info, see also:

    Should you solve this issue, please let me know!

  • edited 4:21PM

    Hi Sebastiaan,

    thank you very much! At the moment i have found a temporary solution, although not really smart. i added those lines to text_input.py( line 152):

    # QWERTY - Remapping
                elif resp =="z":
                    response += "y"
                elif resp =="y":
                    response += "z" 
                elif resp =="[":
                    response += "ue"
                elif resp ==";":
                    response += "oe"
                elif resp =="'":
                    response += "ae"
                elif resp =="/":
                    response += "-"

    i know that is absoluely unsophistcated, but due time pressure that has to work at the moment.

    wouldn't it be possible to append an wxpython.textframe or wxpython.radiobuttons or something like that to a sketchpad?

    Cheers! Björn

  • edited 4:21PM

    Great. If it works, it works, right?

    Regarding wxWidgets. I believe that wxWidgets requires it's own window to draw on, so you cannot use a PyGame/ PsychoPy window. There might be a hack to make it possible, but you'd have to ask Google.

    If you'd like to use controls, you could also take a look at the source of the questionnaire plug-ins. These come with PGU, which is a GUI toolkit that draws controls using PyGame. It's nowhere near as fancy as wxWidgets though (or Qt4, Gtk3, etc.)

  • edited 4:21PM

    That is absolutely right :-)
    I will ask the mighty google if there is a way to use sketchpad as a panel for wx...
    Thanks! for the hint with the questionnaire plugins, i wasn't aware of their existence by now :-)

  • edited 4:21PM

    i have tried the questionnaire plugin, first impression:great stuff!
    what i am missing is the access to the response variable in the open_question item, though open_question.py seems to collect a response.

  • edited 4:21PM

    Ok, found out some interesting things, i hope i am not disturbing anyone ? :-)

    The questionnaire plugins store their response into a variable called "response". Unfortunately this variable is not called as the "standard" openSesame response variable, such as "response_itemname".

    And, the Variable Inspector locates the corresponding "response" under the name ("in item") of the first item of the respective sequence (e.g. "welcome", so it was a bit tricky to find.

    Furthermore, to log the response of any questionnaire item, one will need a logger item and mark "response".

    To log different responses from different questionnaire plugins within one sequence, you will need to append a logger item directly after every (!) questionnaire plugin. Else, the "response" from questionnaire item no.1 would be overwritten from "response" of questionnaire item no. 2.

    I am happy to add that the open_question item enables QWERTZ (see above)! :-)
    Cheers, Björn

  • edited May 2012

    Thanks for pointing out these issues out! Indeed, these plug-ins don't expose their variables properly. I marked it in the bug tracker: https://github.com/smathot/opensesame_questionnaire_plugins/issues/4

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games