gint_strcat/src/keyboard/keyboard_config.c

32 lines
678 B
C

#include <internals/keyboard.h>
#include <keyboard.h>
#include <clock.h>
#include <timer.h>
/*
keyboard_setFrequency()
Sets the keyboard frequency (in Hz).
*/
void keyboard_setFrequency(int frequency)
{
int setting = clock_setting(frequency, Clock_Hz);
if(setting <= 0) return;
timer_reload(TIMER_KEYBOARD, setting);
}
/*
keyboard_setRepeatRate()
Sets the default repeat rate for key events. The unit for the argument
is the keyboard period.
For example at 32 Hz, values of (20, 4) will imitate the system
default.
*/
void keyboard_setRepeatRate(int first, int next)
{
if(first < 0) first = 0;
if(next < 0) next = 0;
repeat_first = first;
repeat_next = next;
}