use of "||" and "&&" in multi statements

sir ,
please take a look at my code . In this code when key1 will be pressed ,to get Function A .

if (( kpd.key[i].stateChanged ) && (kpd.key[i].kchar == 1))   // --------------------------------------
            {
                switch (kpd.key[i].kstate) {  // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
                    case PRESSED:
                       Function A;
                break;
                    case HOLD:
                   //  Do when Hold
                break;
                    case RELEASED:
                    //  Do when Released
                break;
                /*    case IDLE:
                    //  Do when IDLE     */
                }
            }

Now , I will make a change related to a variable integer.
suppose i put (int MODE = 0;) Variable integer,

I want , to get "Function A" when key1 is pressed and (MODE = 0, or MODE = 3,or MODE = 5 )
if I want , to get "Function B" when key1 is pressed and (MODE = 1, or MODE = 2,or MODE = 4 )

HOW can i add key1 pressing with (MODE =0 and MODE =3 and MODE =5) ,in single line to get FunctionA

HOW can i add key1 pressing with (MODE =1 and MODE =2 and MODE =4) ,in single line to get FunctionB

i hope you understand . please solve this issue ?????

                switch (kpd.key[i].kstate) {  // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
                    case PRESSED:
                       if(MODE==0 || MODE==3 || MODE==5)
                         {
                         FunctionA();
                         }
                       if(MODE==1 || MODE==2 || MODE==4)
                         {
                         FunctionB();
                         }
                      break;

wildbill, Wouldn't execute FunctionA or FunctionB on any keypad key PRESSED?

I was thinking along the same line but the OP terminology got in my way.

HOW can i add key1

Is key1 a key separate from the key pad or is that meant to be key[1]?

(kpd.key[i].kchar == 1)

I think you want:

(kpd.key[i].kchar == '1')

wildbill:

                switch (kpd.key[i].kstate) {  // Report active key state : IDLE, PRESSED, HOLD, or RELEASED

case PRESSED:
                      if(MODE==0 || MODE==3 || MODE==5)
                        {
                        FunctionA();
                        }
                      if(MODE==1 || MODE==2 || MODE==4)
                        {
                        FunctionB();
                        }
                     break;

. thank you sir , it is working

johnwasser:

(kpd.key[i].kchar == 1)

I think you want:

(kpd.key[i].kchar == '1')

(kpd.key*.kchar == 1) and*
(kpd.key*.kchar == '1') both are working . I checked. Thank you*