Skip to main content

Software Keyboard

What is the Software Keyboard Applet?

The system software keyboard applet is a built-in feature on the consoles that provides an on-screen keyboard interface. This applet is used for text input in various applications and games, offering a familiar and consistent way for users to enter text using the console's hardware.

How it Works

When you need to input text within your game or application, simply call love.keyboard.setTextInput(true). The system software keyboard applet is then invoked, displaying an on-screen keyboard. Users can then type using the console's controls or touchscreen, and the text is passed back to your application through the love.textinput callback.

Differences

In LÖVE Potion, the love.keyboard.setTextInput function differs from standard LÖVE by accepting a second argument as a table of options. These options modify the behavior of the software keyboard, rather than offsetting it. Here’s the list of options:

Options

OptionTypeNotesDefault
typestringbasic, numpad, and standard1basic
passwordbooleanMakes text hidden after entryfalse
hintstringText to prompt for on input"Enter String"
lengthnumberMaximum length of the input string20

1 Nintendo Switch only

main.lua
-- Example usage in LÖVE Potion
love.keyboard.setTextInput(true, {
type = "basic",
password = false,
hint = "Enter your username"
})