powercat-creator-kit icon indicating copy to clipboard operation
powercat-creator-kit copied to clipboard

Keyboard Shortcut code component - unclear what to add to the KeyConfig

Open kayetter opened this issue 3 years ago • 1 comments

In the keyboard shortcut code component you provide an example to add to the KeyConfig property: ["alt + r","alt + a","alt + d","alt + b","alt + p","alt + l","alt + t","alt + k"]

The KeyConfig is expecting a text value which the above is not so I am getting an error. I added a button where OnSelect property is

Set(keyConfig,JSON(["alt + r","alt + a","alt + d","alt + b","alt + p","alt + l","alt + t","alt + k"]))

and then set KeyConfig to my var keyConfig.

Except this results in the below string which does not trigger the OnChange property. What am I doing wrong?

[
    {
        "Value": "alt + r"
    },
    {
        "Value": "alt + a"
    },
    {
        "Value": "alt + d"
    },
    {
        "Value": "alt + b"
    },
    {
        "Value": "alt + p"
    },
    {
        "Value": "alt + l"
    },
    {
        "Value": "alt + t"
    },
    {
        "Value": "alt + k"
    }
]

AB#1485

kayetter avatar Apr 10 '23 21:04 kayetter

This worked but it is very awkward. Is there a better way to do this?

Set(keyConfig,Concatenate("[",Char(34),"a",Char(34),"]"));

I am trying make a cell counter using a 10 key keyboard although this might be other than what was intended for this component.

Also, the number pad digits do not trigger the OnChange property.

You might want to add a start property to start (to mount an unmount?) the capture because once you add the KeyConfig, you can't ever use those keys again to make edits to the rest of your app.

kayetter avatar Apr 10 '23 21:04 kayetter