Python on screen keyboard

I am in the middle of creating a tablet for my RPI and i am i need of a way to control the keyboard from the screen so i think my best bet is an on screen keyboard.

My question is how would i go about doing this in python and what if any libraries would be useful for this?

I have found multiple on-screen keyboards for linux but i cannot seem to find an opensource one i can take a look at too see how it is built.

http://taufanlubis.wordpress.com/2008/04/19/gtkeyboard-%E2%80%93-on-screen-keyboard-for-linux/

Answers


Are you familiar with tinter? I'm not going to get into too much detail, but here's an idea of how you could structure your code if you were to do it yourself.

1) Build a tkinter canvas where you want your keyboard

2) Build tkinter rectangles for each individual key (this is going to be a pain since you'll probably have to do each one manually).

3) Give all the rectangles the same tag

4) Create a dictionary containing the coordinates of each key and the corresponding letter/function.

5) Bind the tag created for each rectangle to the same function

6) Check event.x and event.y against your dictionary

7) Return the key that was pressed

8) Profit


I had the same problem and did not find an appropriate solution other than creating (or at least heavily improving) one myself. I used

petemojeiko's virtual keyboard on GitHub

as a starting point for creating my own solution (opensource and on GitHub). It needed to be usable in typing a complex password, so it sports keys for lower- and uppercase letters, numerals and (most) symbols a regular keyboard supports.


Need Your Help

Wamp Server -- Cannot execute any PHP Rest API

php mysql .htaccess rest wampserver

I have Wamp Server 2.5 with Apache 2.4.9 on Windows 64x. I created a PHP using Slim REST Api project under c:\wamp\www\tridrops folder. I have my index.php, that I am trying to execute at c:\wamp\www\

How to set a div's rotation angle in javascript?

javascript css

Or more generally, is there a way to add arbitrary CSS to an HTML element in javascript without JQuery?