Tuesday, February 2, 2010

Hacking the TTouchKeyboard Part III

Hacking the TTouchKeyboard Part I
Hacking the TTouchKeyboard Part II
Hacking the TTouchKeyboard Part III
Hacking the TTouchKeyboard Part IV
Hacking the TTouchKeyboard Part V (not published yet)

This post is going to be short because it is just an example application to illustrate how to convert an XML touch keyboard layout the binary version that you can then add as a resource and use from your touch applications. You can download the source to the command line utility called kcc (stands for Keyboard Command line Compiler).

My next post will be the documentation for the XML layout and the final post on hacking the TTouchKeyboard will walk you through the steps to make this all work.

13 comments:

Pawel Rewak said...

The tiles of the links after part 1 say "Park" not "Part" as you would expect.

Chris Bensen said...

Pawel, thanks. I seem to make that typo a lot for some odd reason :)

Edin Firs said...

How to change just the keyboard font typeface?

Chris Bensen said...

Edin, currently the only way to change the font is to derive from TCustomKeyboardButton or TKeyboardButton override the Paint method and assign your class to TTouchKeyboard.DefaultButtonClass.

I hope this helps.

John C. said...

Any chance posts 4 and 5 will come to light? I could really use it! Making this custom keyboard is a pain. Thanks!

Chris Bensen said...

Hi John,

I forgot to go back and update the links but I did publish post 4. I just did that now so you should be able to get to the documentation easily.

As for post 5, I never had time to finish it and since I no longer work for Embarcadero I don't use Delphi or currently have access to what I'd need to publish that post, sorry! if you have questions feel free to email me and I will try to answer them the best that I can.

Izno said...

it's a shame the load_layout_from_xml is not provided...
Could you please indicate how to create a new resource in windows with from a loaded layout? so that it could be used with the touchkeypad?
thanks a lot

Chris Bensen said...

Hi Izno,

Look at the kcc.dpr in the example I provided. There is a function called LoadXmlFile on line 8 that should do what you want.

Izno said...
This comment has been removed by the author.
Izno said...

Hello Chris, thanks a lot for your answer. I've just downloaded the file and will review this.

Just a question: how to assign the Tvirtualkeyboard to the TTouchkeyboard?
The TTouchkeyboard has a property layout which is only accessible at design time... And the setlayout method is private.. I'm lost on that.

Many thanks for your help

Izno said...

More info: when listing the available layouts in you demo prg, I find 4 layouts: NUMPADKEYBOARD, STANDARD101KEYBOARD, STANDARD102KEYBOARD, STANDARD106KEYBOARD.
If I try to set TTouchKeyboard.layout value to one of the above value, the keyboard layout is not found. On my machine only layouts named "Standard" or "NumPad" (key sensitive) are accepted. How to make a new layout available and accessible throught the layout property, and with what name?

Regards

Chris Bensen said...

Since I no longer work on Delphi I don't have a copy of Delphi in front of me to help you out except what I recall from memory, sorry. I wrote the touch keyboard over five years ago so memory is a bit rusty on the details. the reason you only see numpad and standard is because those are the only keyboard layout. There are sub layouts which are the 101, 102 and 106 key keyboards. All of the sources available sort should be pretty easy to figure out what is going on. Good luck!

Izno said...

THanks a lot Chris for your help!
I've made it through loading my own layout from the xml file.
I've created my own class derivated from a Ttouchkeyboard that's able to directly load a virtualLayout from a xml file.
Thanks a lot again,

Izno

Post a Comment