From 889dc612cfa80811a7876ba3b380281ad6dbdcf2 Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Mon, 30 Jun 2025 13:50:11 +0300 Subject: [PATCH] kdrive: add OS/platform specific bell callback Allow OS/platform specific bell implementation. Signed-off-by: stefan11111 Signed-off-by: Enrico Weigelt, metux IT consult --- hw/kdrive/src/kdrive.h | 2 +- hw/kdrive/src/kinput.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index a24e1d5b7..34e87347c 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -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 { diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 539118116..a38d873b3 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -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);