Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard UI for Tingbot #25

Open
kennysmed opened this issue May 20, 2016 · 1 comment
Open

Keyboard UI for Tingbot #25

kennysmed opened this issue May 20, 2016 · 1 comment

Comments

@kennysmed
Copy link

Here are the designs for the keyboard:

01
Default view

02 - caps
Caps

03 - numbers
Numbers

04 - symbols
Symbols

05 - colour variation example
Colour Variation Example

06 - colour variation example
Colour Variation Example

07 - colour variation example
Colour Variation Example

instructions
Instructions / Guide

01
02
03
04
05
06
Custom Icons (These may appear invisible on this page but i assure you there are there :) !)

Joe will follow up with the API

@joerick
Copy link
Member

joerick commented Jun 13, 2016

As for the API, I'm thinking a blocking function for really simple use, just like a raw_input() call-

def keyboard_prompt(initial='', prompt='', ok_button='OK', background_color='black', allow_empty=True):
    # implementation here
    pass

So programs can use it like

password = keyboard_prompt(prompt='Password', initial='qwerty123')

Full example app:

import tingbot
from tingbot import *

state = {}

@button.press('left')
def change_name():
    state['name'] = keyboard_prompt(state['name'], prompt='Name')

def loop():
    screen.fill(color='black')
    screen.text('Hello, %s!' % state['name'])

tingbot.run(loop)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants