Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Kodi's keyboard class. More...

Classes

class  XBMCAddon::xbmc::Keyboard
 

Functions

 XBMCAddon::xbmc::Keyboard::Keyboard (const String &line=emptyString, const String &heading=emptyString, bool hidden=false)
 
 XBMCAddon::xbmc::Keyboard::~Keyboard () override
 
 XBMCAddon::xbmc::Keyboard::doModal (...)
 

Function: doModal([autoclose])


Show keyboard and wait for user action.
 
 XBMCAddon::xbmc::Keyboard::setDefault (...)
 

Function: setDefault(line)


Set the default text entry.
 
 XBMCAddon::xbmc::Keyboard::setHiddenInput (...)
 

Function: setHiddenInput(hidden)


Allows hidden text entry.
 
 XBMCAddon::xbmc::Keyboard::setHeading (...)
 

Function: setHeading(heading)


Set the keyboard heading.
 
 XBMCAddon::xbmc::Keyboard::getText ()
 

Function: getText()


Returns the user input as a string.
 
 XBMCAddon::xbmc::Keyboard::isConfirmed ()
 

Function: isConfirmed()


Returns False if the user cancelled the input.
 

Variables

String XBMCAddon::xbmc::Keyboard::strDefault
 
String XBMCAddon::xbmc::Keyboard::strHeading
 
bool XBMCAddon::xbmc::Keyboard::bHidden
 
String XBMCAddon::xbmc::Keyboard::strText
 
bool XBMCAddon::xbmc::Keyboard::bConfirmed = false
 

Detailed Description

Kodi's keyboard class.

Class: xbmc.Keyboard([default, heading, hidden])

Creates a new Keyboard object with default text heading and hidden input flag if supplied.

Parameters
default: [opt] string - default text entry.
heading: [opt] string - keyboard heading.
hidden: [opt] boolean - True for hidden text entry.

Example:

..
kb = xbmc.Keyboard('default', 'heading', True)
kb.setDefault('password') # optional
kb.setHeading('Enter password') # optional
kb.setHiddenInput(True) # optional
kb.doModal()
if (kb.isConfirmed()):
text = kb.getText()
..

Function Documentation

◆ doModal()

void XBMCAddon::xbmc::Keyboard::doModal ( ...)

Function: doModal([autoclose])


Show keyboard and wait for user action.

Parameters
autoclose[opt] integer - milliseconds to autoclose dialog. (default=do not autoclose)

Example:

..
kb.doModal(30000)
..

◆ getText()

String XBMCAddon::xbmc::Keyboard::getText ( )

Function: getText()


Returns the user input as a string.

Note
This will always return the text entry even if you cancel the keyboard. Use the isConfirmed() method to check if user cancelled the keyboard.
Returns
get the in keyboard entered text

Example:

..
text = kb.getText()
..

◆ isConfirmed()

bool XBMCAddon::xbmc::Keyboard::isConfirmed ( )

Function: isConfirmed()


Returns False if the user cancelled the input.

Returns
true if confirmed, if cancelled false

Example:

..
if (kb.isConfirmed()):
..

◆ Keyboard()

XBMCAddon::xbmc::Keyboard::Keyboard ( const String & line = emptyString,
const String & heading = emptyString,
bool hidden = false )

◆ setDefault()

void XBMCAddon::xbmc::Keyboard::setDefault ( ...)

Function: setDefault(line)


Set the default text entry.

Parameters
linestring - default text entry.

Example:

..
kb.setDefault('password')
..

◆ setHeading()

void XBMCAddon::xbmc::Keyboard::setHeading ( ...)

Function: setHeading(heading)


Set the keyboard heading.

Parameters
headingstring - keyboard heading.

Example:

..
kb.setHeading('Enter password')
..

◆ setHiddenInput()

void XBMCAddon::xbmc::Keyboard::setHiddenInput ( ...)

Function: setHiddenInput(hidden)


Allows hidden text entry.

Parameters
hiddenboolean - True for hidden text entry.

Example:

..
kb.setHiddenInput(True)
..

◆ ~Keyboard()

XBMCAddon::xbmc::Keyboard::~Keyboard ( )
overridedefault

Variable Documentation

◆ bConfirmed

bool XBMCAddon::xbmc::Keyboard::bConfirmed = false

◆ bHidden

bool XBMCAddon::xbmc::Keyboard::bHidden

◆ strDefault

String XBMCAddon::xbmc::Keyboard::strDefault

◆ strHeading

String XBMCAddon::xbmc::Keyboard::strHeading

◆ strText

String XBMCAddon::xbmc::Keyboard::strText