Forum Archive

Custom keyboard made using scene module!

JadedTuna

Hey there guys! Here is a small keyboard I made for use with scene.Scene.

It supports different layouts (defined by user), but I have just one for now. I've tested it only on iPad3 in landscape mode, so I am not sure how it will behave on smaller devices, or when rotated.

Hopefully you will like it!

Pull requests are welcome, as I am tired already and the code is a little bit messy :D

GitHub: https://github.com/Vik2015/scene-keyboard

Here is a screenshot. Button F is pressed that's why it is gray:
It's unavailable :(

nope

Quite cool, how efficient is it?

JadedTuna

@nope, not sure what you mean by how efficient it is. You can already assign actions to buttons :)
Later I am going to add numbers layout and special buttons that require images.

ccc

Cool... You might look at another attempt to do this... http://omz-forums.appspot.com/pythonista/post/6407519169675264 There is an undocumented scene.Button that you can use.

JadedTuna

@ccc, thanks for the link, but I've already seen it :). Actually, it gave me inspiration to make my own keyboard.

JadedTuna

New version available!

Keyboard class now has two new useful functions: setup() and init().

setup gets called right after __init__, so you can modify it instead of modifying __init__.

init should be called before keyboard is first drawn. It may contain code for binding keys, etc.

When creating a button using layout.addTextButton or layout.addSpecialTextButton you can specify button ID, which can be later used with layout.getButtonByID.

I've split file into several smaller files, so now it is much easier to read and manage the code.
You can now create layouts in different files and then import them and use keyboard.setLayout to use it.

Built-in iPad landscape layout now supports numbers and switching between layouts (letters and numbers).

Hope it will be useful for someone :)