From 06fd9e335d114bc58ce28d63025c8961ed98a905 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Wed, 9 Aug 2000 16:12:06 +0000 Subject: [PATCH] Implement gdk_beep() (woohoo!) Implement gdk_beep() (woohoo!) --- gdk/linux-fb/gdkinput-ps2.c | 17 +++++++++++++++++ gdk/linux-fb/gdkmain-fb.c | 5 ----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gdk/linux-fb/gdkinput-ps2.c b/gdk/linux-fb/gdkinput-ps2.c index cb57ecb8d1..1e96eabdef 100644 --- a/gdk/linux-fb/gdkinput-ps2.c +++ b/gdk/linux-fb/gdkinput-ps2.c @@ -23,6 +23,7 @@ #include "gdkkeysyms.h" #include "gdkprivate-fb.h" #include +#include #include #include #include @@ -1448,6 +1449,22 @@ tty_keyboard_open(void) return retval; } +void +gdk_beep (void) +{ + static int pitch = 600, duration = 100; + gulong arg; + + if(!keyboard) + return; + + /* Thank you XFree86 */ + arg = ((1193190 / pitch) & 0xffff) | + (((unsigned long)duration) << 16); + + ioctl(keyboard->fd, KDMKTONE, arg); +} + void keyboard_init(void) { diff --git a/gdk/linux-fb/gdkmain-fb.c b/gdk/linux-fb/gdkmain-fb.c index f506537c37..c81088fd71 100644 --- a/gdk/linux-fb/gdkmain-fb.c +++ b/gdk/linux-fb/gdkmain-fb.c @@ -467,11 +467,6 @@ gdk_key_repeat_restore (void) } -void -gdk_beep (void) -{ -} - extern void keyboard_shutdown(void); void