Initialize the other fields of this data structure (apply_settings): Use
2001-07-26 Bradford Hovinen <hovinen@ximian.com> * keyboard-properties.c (apply_settings): Initialize the other fields of this data structure (apply_settings): Use lookup table to get the values to put in kbdsettings
This commit is contained in:
parent
b9b13ebbbc
commit
71942b3edf
2 changed files with 11 additions and 2 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
* keyboard-properties.c (apply_settings): Initialize the other
|
* keyboard-properties.c (apply_settings): Initialize the other
|
||||||
fields of this data structure
|
fields of this data structure
|
||||||
|
(apply_settings): Use lookup table to get the values to put in
|
||||||
|
kbdsettings
|
||||||
|
|
||||||
* Makefile.am (bonobo_sources): Remove bonobo-property-editor-range.[ch]
|
* Makefile.am (bonobo_sources): Remove bonobo-property-editor-range.[ch]
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,13 @@ apply_settings (Bonobo_ConfigDatabase db)
|
||||||
int rate, delay, volume;
|
int rate, delay, volume;
|
||||||
int bell_volume, bell_pitch, bell_duration;
|
int bell_volume, bell_pitch, bell_duration;
|
||||||
|
|
||||||
|
static int rates[] = {
|
||||||
|
255, 192, 128, 64
|
||||||
|
};
|
||||||
|
static int delays[] = {
|
||||||
|
10000, 6000, 3000, 0
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
|
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
|
||||||
XF86MiscKbdSettings kbdsettings;
|
XF86MiscKbdSettings kbdsettings;
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,8 +75,8 @@ apply_settings (Bonobo_ConfigDatabase db)
|
||||||
&error_base_return) == True)
|
&error_base_return) == True)
|
||||||
{
|
{
|
||||||
kbdsettings.type = 0;
|
kbdsettings.type = 0;
|
||||||
kbdsettings.rate = rate;
|
kbdsettings.rate = rates[rate];
|
||||||
kbdsettings.delay = delay;
|
kbdsettings.delay = delays[delay];
|
||||||
kbdsettings.servnumlock = False;
|
kbdsettings.servnumlock = False;
|
||||||
XF86MiscSetKbdSettings (GDK_DISPLAY (), &kbdsettings);
|
XF86MiscSetKbdSettings (GDK_DISPLAY (), &kbdsettings);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue