microsoft / powercat-creator-kit

This toolkit helps create well-designed Power App experiences on the web & mobile. It contains a component library; PCF controls and other utilities that increase developer productivity.
MIT License
321 stars 53 forks source link

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

Open kayetter opened 1 year ago

kayetter commented 1 year ago

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 commented 1 year ago

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.