Demo Scripts

Tutorial Demos

How to Log a Non-Printable Key

How to Log a Non-Printable Key

Shows how you can log a non-printable key by its NeuroTask Scripting name. Als gives a simple function you can use.

Set the Font Size for All Controls

Set the Font Size for All Controls

If you are using the standard controls like input(), instruction(), select() the standard font size is usually too large. You can make it smaller as follows with one line: main.setfontsize(70) (for 70% sized font size).

Clearing the Key Buffer

Clearing the Key Buffer

If you use an awaitkey() the subjects's response will 'linger' even after the awaitkey() call and will remain active. E.g., an Enter key stroke will 'linger' and remain active and will 'click' the following OK button. This can easily be prevented by using preventDefault(), a standard JavaScript function. See the code.

White Text on Black

White Text on Black

To achieve white text on a completely black background, you can use a new Box as described in the book but it is usually easier to restyle the main function, because all of the standard controls still work and are easier to use, especially for beginners with NeuroTask Scripting. See the code.

Get URL Parameters

Get URL Parameters

Illustrates how to send subjects to a different webiste (e.g., a survey in Google Forms). Also shows how to decode any parameters sent from another site with your script (e.g., when using NeuroTask with a proprietary subject management system).


Script 1.4

Script 1.4


Sound Simplest

Sound Simplest