How to create my own T9 keyboard

Hi!

I want to create an app for myself that uses a T9 keyboard, as I find it the best input method for small touchscreens. I know that both QWERTY and T9 keyboards are available in the latest update, but they don’t work on the Forerunner 955.

I’ve created nine drawables, each covering 1/9 of the screen area. However, as far as I know, I can't create custom-shaped buttons in WatchUi. Is this true? Do hit areas always have to be rectangular?

If so, how can I retrieve the coordinates of a polygon-shaped button (as defined in the drawables) within the code? I’d like to implement a custom algorithm to check whether a tap falls inside or outside the button’s shape.

  • CIQ doesn't handle custom shapes, but you can, by returning true or false in onTap(): you check the coordinates of the touch and if it's inside your area you handle it and return true. If it's outside then return false.

    I'm not sure if you'll be able to use the polygon shapes for this, probably you'll need to conver them to some Monkey C structure and check it in your own code.

  • You may find that things are a bit easier if you do direct dc calls.  Things like drawRoundedRectangle, fillPolygon, etc.  For input, you see an x/y and it kind of depends on how exact you want to be.

    for something like a rounded rectangle, you could just assume a rectangle, with the difference being how it looks on the screen