PiStorms  4.012
PiStorms Library Reference by mindsensors.com
 All Classes Namespaces Files Functions Variables
TouchScreenInput.TouchScreenInput Class Reference

Create a TextBox with virtual keyboard for user Input. More...

Public Member Functions

def __init__
 
def bind_led_off_func
 To bind a function to turn off the LEDs
If you want to be real fancy and provide a visual feedback using LED, bind a function to turn them off. More...
 
def bind_led_on_func
 To bind a function to turn on the LEDs
If you want to be real fancy and provide a visual feedback using LED, bind a function to turn them on. More...
 
def update_textbox
 force an update to the text box You don't need to call this function in your program
 
def redraw
 Draw the keyboard
The keyboard could change based on shift/numeric modifiers, this function redraws when modifier is applied. More...
 
def getInput
 Call this function to get input from the user. More...
 

Public Attributes

 scrn
 The screen where you will be drawing the dialog box
you do not need to access this variable in your program.
 
 lm
 
 w
 

Static Public Attributes

 led_on_func = None
 
 led_off_func = None
 

Detailed Description

Create a TextBox with virtual keyboard for user Input.

Use in your program as:

1 from PiStorms import PiStorms
2 from TouchScreenInput import TouchScreenInput
3 ...
4 psm = PiStorms()
5 textbox = TouchScreenInput(psm.screen)
6 userInput = textbox.getInput()
7 print str(userInput["response"])
Remarks
For example, see 04-KeyboardDemo.py

Member Function Documentation

def TouchScreenInput.TouchScreenInput.bind_led_off_func (   self,
  func_name 
)

To bind a function to turn off the LEDs
If you want to be real fancy and provide a visual feedback using LED, bind a function to turn them off.


This function is optional, but if you bind one, be sure also to bind off function.

def TouchScreenInput.TouchScreenInput.bind_led_on_func (   self,
  func_name 
)

To bind a function to turn on the LEDs
If you want to be real fancy and provide a visual feedback using LED, bind a function to turn them on.


This function is optional, but if you bind one, be sure also to bind off function.

def TouchScreenInput.TouchScreenInput.getInput (   self,
  hide = False 
)

Call this function to get input from the user.

Returns
a tuple containing 'submitted' & 'response'
submitted is True when user pressed Submit.
submitted is False when user pressed Cancel.
response contains any text that user entered.
def TouchScreenInput.TouchScreenInput.redraw (   self,
  layout,
  start 
)

Draw the keyboard
The keyboard could change based on shift/numeric modifiers, this function redraws when modifier is applied.


The documentation for this class was generated from the following file: