expyriment.io.TextInput

class expyriment.io.TextInput(message='', position=None, character_filter=None, length=None, message_text_size=None, message_colour=None, message_font=None, message_bold=None, message_italic=None, message_right_to_left=None, user_text_size=None, user_text_bold=None, user_text_font=None, user_text_colour=None, user_right_to_left=None, background_colour=None, frame_colour=None, gap=None, screen=None, background_stimulus=None, **kwargs)

A class implementing a text input box.

__init__(message='', position=None, character_filter=None, length=None, message_text_size=None, message_colour=None, message_font=None, message_bold=None, message_italic=None, message_right_to_left=None, user_text_size=None, user_text_bold=None, user_text_font=None, user_text_colour=None, user_right_to_left=None, background_colour=None, frame_colour=None, gap=None, screen=None, background_stimulus=None, **kwargs)

Create a text input box.

Parameters:
messagestr, optional

message to show

position(int, int), optional

position of the TextInput canvas

lengthint, optional

the length of the text input frame in number of characters

character_filterlist, optional

list of character codes to filter for

message_text_sizeint, optional

text size of the message

message_colour(int, int, int), optional

text colour of the message

message_fontstr, optional

text font of the message

message_boldbool, optional

True if message text should be bold

message_italicbool, optional

True if message text should be italic

message_right_to_leftbool, optional

whether or not the message text should be presented right-to-left

user_text_sizeint, optional

text size of the user input

user_text_fontstr, optional

text font of the user input

user_text_colour(int, int ,int), optional

text colour of the user input

user_text_boldbool, optional

True if user text should be bold

user_right_to_leftbool, optional

whether or not the user text should be presented right-to-left

background_colour(int, int, int), optional
frame_colour(int, int, int)

colour of the frame

gapint, optional

gap between message and user input

screenio.Screen, optional

screen to present on

background_stimulusvisual Expyriment stimulus, optional

The background stimulus is a second stimulus that will be presented together with the TextInput. For both stimuli overlap TextInput will appear on top of the background_stimulus

Notes

This stimulus is not optimized for timing accurate presentation!

property background_colour

Getter for background_colour

property background_stimulus

Getter for background_stimulus

property character_filter

Getter for character filter

property frame_colour

Getter for frame_colour

property gap

Getter for gap

get(default_input='', process_control_events=True)

Get input from user.

Parameters:
default_inputstr, optional

default input in the textbox

process_control_eventsbool, optional

process io.Keyboard.process_control_keys() and io.Mouse.process_quit_event() (default = True)

Returns:
text_input: str or None

returns the entered text string. If get() is interrupted by a CallbackQuitEvent from a registered wait-callback-function get() returns None.

Notes

This displays and updates the input box automatically. Pressing ENTER returns the user input.

property length

Getter for length

property logging

Getter for logging.

property message

Getter for message

property message_bold

Getter for message_bold

property message_colour

Getter for message_colour

property message_font

Getter for message_font

property message_italic

Getter for message_italic

property message_right_to_left

Getter for message_right_to_left

property message_text_size

Getter for message_text_size

property position

Getter for position

property screen

Getter for screen

set_logging(onoff)

Set logging of this object on or off

Parameters:
onoffbool

set logging on (True) or off (False)

property user_right_to_left

Getter for user_right_to_left

property user_text_bold

Getter for user_text_bold

property user_text_colour

Getter for user_text_colour

property user_text_font

Getter for user_text_font

property user_text_size

Getter for user_text_size