Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

BPS-Marcel
Level 1
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
_Bruce_Robertson
Level 10
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

BPS-Marcel
Level 1
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

_Bruce_Robertson
Level 10
Level 10

Hi Marcel,

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

Regards

Bruce