kdrive: add OS/platform specific bell callback

Allow OS/platform specific bell implementation.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
stefan11111
2025-06-30 13:50:11 +03:00
committed by Enrico Weigelt
parent 8ba351aa96
commit 889dc612cf
2 changed files with 6 additions and 1 deletions

View File

@@ -285,7 +285,7 @@ typedef struct _KdOsFuncs {
void (*Disable) (void);
void (*Fini) (void);
void (*pollEvents) (void);
void (*Bell) (int, int, int);
void (*Bell) (int, int, int); /* if not NULL called instead of the keyboard driver's function */
} KdOsFuncs;
typedef struct _KdPointerMatrix {

View File

@@ -383,6 +383,11 @@ DDXRingBell(int volume, int pitch, int duration)
{
KdKeyboardInfo *ki = NULL;
if (kdOsFuncs->Bell) {
kdOsFuncs->Bell(volume, pitch, duration);
return;
}
for (ki = kdKeyboards; ki; ki = ki->next) {
if (ki->dixdev->coreEvents)
KdRingBell(ki, volume, pitch, duration);