This function sets the state (Eabled/Disabled) of the key click sound.

Syntax

int SetUseKeyClick(
  int mode
);

Parameters

mode
[in] Sets the state of the key click sound.
ValueDescription
ON Enable the key click sounds.
OFF Disabled the key click sounds.
CURRENT_MODE Returns the current key click sound state.

Return value

Returns the key click sound state after the change.

Remarks

This API is compatible with OS version TH15J06 or later.

Requirements

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

Sample

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

void main(void)
{
    char ch;
    int  set_mode;
    int  exit_flag;
    int  ret;

    GotoXY( 1,1 );
    printf("Press Key\n");

    exit_flag = 0;
    while(1)
    {
        if (kbhit())
        {
            ch = getchar();
            switch(ch)
            {
            case NUM1_KEY:
                set_mode = ON;
                exit_flag = 1;
                break;

            case NUM2_KEY:
                set_mode = OFF;
                exit_flag = 1;
                break;

            case NUM3_KEY:
                set_mode = CURRENT_MODE;
                exit_flag = 1;
                break;

            default:
                GotoXY(1,2);
                printf("ERROR !!");
                break;
            }
        }
        ResetKey();
        if (exit_flag) break;
    }

    ret = SetUseKeyClick(set_mode);
    GotoXY(1,2);
    printf("ret = %s", (ret > 0)? "ON" : "OFF");

    while(1)
    {
        Idle();
    }
}

Last updated: 2022/03/10