Howdy, Stranger!

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

Supported by

How to handle Num Pad input in OSweb?

Hi!

I'm trying to get people to rate certain things, which at the moment they do with just the numbers on the keyboard (which works fine!). However I want them to rate from 0 to 9. On the normal keyboard, the 0 comes after the 9 which makes it a bit less intuitive to score something a 0 instead of a 1 for example. Therefore I wanted to use the num pad for this, as the numbers are closer together here.

Apart from things such as 0;1;2;3 and ENTER;RETURN etc in my keyboard response, I've also tried putting in NUM_0However, I get the following error:

Is there any way to handle numpad input with OSWeb?

I've also tried other ways (e.g. kp0, np0) and while kp0 does not give an error, it does not allow me to type something in (as far as I can tell).

Will this difference in naming the keys be an issue if the experiment is running on other computers? (e.g. if their internal system does indeed code the numpad keys as NUM_0, while someone elses as np0)

Kind regards,

Sanne

Comments

  • Hi @Sannee ,

    The numpad keys are called kp0 , kp1 , etc. This is not obvious or documented properly, but you can see the list of valid key names here.

    You mention that you've tried kp0 , but that this did not allow you to type in anything. My first guess is that the numlock was not enabled. Could that be it? For me (when enabling numlock) it works perfectly under Chrome.

    — Sebastiaan

    Buy Me A Coffee

  • edited April 17

    Hi Sebastiaan!

    Thanks for your quick answer! I have tried turning the num pad on and off while in the OSweb experiment version, but I cannot see anything happening sadly. My browser is Firefox, but I also cannot get it to work in the quick run environment.

    This is what I currently have:

    The main files here are the "Keyboard000" keyboard response item, where I've allowed the following inputs:

    1;2;3;4;5;6;7;8;9;ENTER;RETURN;RIGHT;LEFT;kp0;kp1;kp2;kp3;kp4;kp5;kp6;kp7;kp8(as people are allowed to switch between boxes with the left and right arrow key and they have to give a score from 0 to 8)

    And the "KeyboardResponse000" Javascript inline file. In this file I indicate what is supposed to happen based on different keyboard inputs. E.g. if someone presses the right arrow key, then the selected box is shifted to the right. As I am currently debugging I have included a console.log(vars.response) statement and a "hey if someone pressed 0 on the num pad, print something" if loop. The console.log does not print anything when I press something on the keypad, even though they are supposed to be accepted inputs, therefore the if statement currently also doesn't print anything.

    Do you know why the keyboard does not even catch the numpad input? I'm currently on version 3.3.7 of OpenSesame with osweb version 1.3.13.0.

    Kind regards,

    Sanne

    EDITED TO ADD: Nevermind! I just found the reason it does not work. My problem was that while things such as num_0, num_1 etc work in the quick test window, they do not work in the OSweb window. I was debuggin in the quick test window and there kp0, kp1 etc are not accepted answers. Therefore I thought it was not working. I opened the console in the OSweb window however and it was actually coming into the printing loop! So from what I understand the kp0,kp1 etc are specifically input for the OSweb and do not work in OpenSesame's own run windows right?

  • Hi @Sannee ,

    Good to hear that you figured it out!

    Indeed, although the goal is to have experiments run in exactly the same way on the desktop and in the browser, the reality is that there are subtle differences, including the names of certain keys. Therefore you should always test an online experiment in the browser during development.

    Also, and this applies both to the desktop and the browser, multiple key names can be used to refer to the same key when specifying the allowed responses (e.g. kp0 and KP0 are synonymous). But of course the response variable has only a single value, in this case the lowercase variant kp0 .

    — Sebastiaan

    Buy Me A Coffee

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