ensan-hcl/CustardKit

Adding utility that make it easy to create flick key only for input

ensan-hcl opened this issue · 2 comments

It is nice to have function that make it easy to create flick key only for input. We'd like to specify only ("input", "label") for each direction.

def simple_input key(center: [str, str], left: [str, str] = None, top: [str, str] = None, right: [str, str] = None, bottom: [str, str] = None) -> KeyData

//example
key = simple_input key((".", ".,!?"), left = (",", ","), top = ("!", "!"), right = ("?", "?"))

It becomes more useful if we can omit label when input and label is the same value:

//example
key = simple_input key((".", ".,!?"), left = ",", top = "!", right = "?")

Consider to add this.

For the Swift, it would nice taking argument as a struct like:

struct SimpleInputArgument {
    let label: String
    let input: String
}

extension SimpleInputArgument: ExpressibleByStringLiteral{
    //implementation
}
extension SimpleInputArgument: ExpressibleByArrayLiteral{
    //implementation
}

Fortunately, we have Union type, so I'd like to use this.