I tried to follow everything here ==>
viewtopic.php?f=51&t=25972&p=317807#p317807
But the image for the keys of the keyboard appeared under the empty keyboard:
https://www.dropbox.com/s/4yw37r3nv6u6u ... d.JPG?dl=0
So I decided to use another code but that line causes problem:
Code: Select all
ui.textbutton('{size=+60} {/size}', clicked=ui.returns(text_code))
https://www.dropbox.com/s/kj58x0ic4j3ka ... t.JPG?dl=0
When the code is:
Code: Select all
ui.textbutton(text_code, clicked=ui.returns(text_code))
https://www.dropbox.com/s/buths4aja67c1 ... l.JPG?dl=0
Here is the full code:
Code: Select all
init python:
text_list1=["A","Z","E","R","T","Y","U","I","O","P","0",
"Q","S","D","F","G","H","J","K","L","M","0",
"W","X","C","V","B","N","É","È","-","0"]
text_list2=["a","z","e","r","t","y","u","i","o","p","0",
"q","s","d","f","g","h","j","k","l","m","0",
"w","x","c","v","b","n","é","è","-","0"]
input_text = ''
input_header = 'Name:'
text_limit = 16
text_list=text_list1
text_group=1
################
label inputter:
if text_group==1:
$text_list=text_list1
elif text_group==2:
$text_list=text_list2
$ ui.frame(xpos=0.5, ypos=0.3, xanchor=0.5, yanchor=0, xminimum=450)
$ ui.vbox()
$ ui.text(input_header+" "+input_text)
$ ui.null(height=30)
$ ui.hbox()
$ ui.textbutton("VALIDER", clicked=ui.returns("Done"))
$ui.textbutton("RETOUR", clicked=ui.returns("Backspace"))
$ui.textbutton("EFFACER", clicked=ui.returns("Deleteall"))
if text_group==1:
$ ui.textbutton("MAJ", clicked=ui.returns("lowercase"))
elif text_group==2:
$ ui.textbutton("MIN", clicked=ui.returns("uppercase"))
$ ui.close()
$ ui.null(height=10)
$ ui.hbox(xalign= 0.5)
python:
for text_code in text_list:
if text_code=="0":
ui.close()
ui.hbox(xalign= 0.5)
elif len(input_text)<=text_limit-1:
ui.textbutton(text_code, clicked=ui.returns(text_code))
$ ui.close()
$ ui.close()
$ button_selection=ui.interact()
if button_selection=="Backspace":
$ input_text=input_text[:-1]
jump inputter
elif button_selection=="Deleteall":
$ input_text=''
jump inputter
elif button_selection=="uppercase":
$text_group=1
jump inputter
elif button_selection=="lowercase":
$text_group=2
jump inputter
elif button_selection=="Done":
return
$ select_text=button_selection
python:
for text_code in text_list:
if select_text==text_code:
input_text += text_code
jump inputter
If you have tips to create a keyboard based only on imagebuttons, I'm also interested.
Thank you in advance!