This function sets the key code returned when the side key is pressed.

Syntax

int SetSideKeyCode(
  int code
);

Parameters

code
[in] Sets the key code returned when a side key is pressed.
ValueDescription
0 Returns nothing. (Default)
SIDE_KEY Set the side key.
TRIGGER_KEY Set the trigger key.
BS_KEY Set the BS key.
ENT_KEY Set the ENT key.
CURRENT_MODE Do not set anything.

Return value

Returns the key code of the set value after the change.

Remarks

Sets the key code returned when the side key is pressed.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Sample

#include <stdio.h>
#include "lib.h"

void main(void)
{
    int ret;
    SetSideKey(ON);
    ret = SetSideKeyCode(CURRENT_MODE);
    printf("prev code[0x%02X]\n\r", ret);
    ret = SetSideKeyCode(SIDE_KEY);
    printf("code[0x%02X]\n\r", ret);
    GotoXY(0,1);
    printf( "Press Side Key: ");
    ResetKey();
    for( ;; ){
        if(kbhit()){
            if (getchar() == SIDE_KEY){
                printf("pressed Side Key\n\r" );
                Sound( TSTANDARD, VHIGH, SMEDIUM, 0 );
            }
        }
    }
}

Last updated: 2022/03/10