Expand my Community achievements bar.

Change the font color of a text field in a table by key-combination

Avatar

Level 1

I want to change the font color of a text field in a table (single cell only) on pressing a key combination. Does anybody know how to do this.

I have a lot of data in a table. During an evaluation of the data in a meeting I want to change the color of the text depending on the result of the meeting. (for example: High risk = CTRL+R makes the text red).

I know how to change the color using a button, but I do not want to add a button after each cell. For this reason I would like to do it on a key combination that alway refers to the active cell.

Many thanks for your help in advance.

Marcel

3 Replies

Avatar

Level 10

Hi,

I don't think you can use the ctrl key like that as those shortcuts will be intercepted by Reader (ctrl-R toggles the ruler display on / off).  You also might have trouble updating the color while you still have focus on it.  You can use the shift key in a similar way, so if you only have lower case characters in the text fields then you can do something like;

if (xfa.event.shift)

{

    switch (xfa.event.change)

    {

        case "R":

            this.fontColor = "255,0,0";

            break;

        case "O":

            this.fontColor = "255,102,0";

            break;

        case "G":

            this.fontColor = "0,255,0";

            break;

    }

    xfa.event.change = ""; // ignore character

}

If you need uppercase characters maybe you can have one button to set "review mode" and test that on the if (xfa.event.shift) line.  But again it wont take effect until you have tabbed out of the field.

Regards

Bruce

Avatar

Level 1

Many thanks for your input!!

Do you also know whether it is possible to act on a pressing an funtion key instead of the shift key?

Regards

Marcel

Avatar

Level 10

Hi Marcel,

Not that I am aware of, it does seem rather limited.

Regards

Bruce