diff options
Diffstat (limited to 'apps/misc.c')
-rw-r--r-- | apps/misc.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/apps/misc.c b/apps/misc.c index 0608595d21..04a6d05c91 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -94,6 +94,10 @@ | |||
94 | #endif | 94 | #endif |
95 | #endif | 95 | #endif |
96 | 96 | ||
97 | #ifdef HAVE_HARDWARE_CLICK | ||
98 | #include "piezo.h" | ||
99 | #endif | ||
100 | |||
97 | /* units used with output_dyn_value */ | 101 | /* units used with output_dyn_value */ |
98 | const unsigned char * const byte_units[] = | 102 | const unsigned char * const byte_units[] = |
99 | { | 103 | { |
@@ -873,14 +877,32 @@ void system_sound_play(enum system_sound sound) | |||
873 | void keyclick_click(int button) | 877 | void keyclick_click(int button) |
874 | { | 878 | { |
875 | /* Settings filters */ | 879 | /* Settings filters */ |
876 | if (global_settings.keyclick && | 880 | if ( |
877 | (global_settings.keyclick_repeats || !(button & BUTTON_REPEAT))) | 881 | #ifdef HAVE_HARDWARE_CLICK |
882 | (global_settings.keyclick || global_settings.keyclick_hardware) | ||
883 | #else | ||
884 | global_settings.keyclick | ||
885 | #endif | ||
886 | && (global_settings.keyclick_repeats || !(button & BUTTON_REPEAT))) | ||
878 | { | 887 | { |
879 | /* Button filters */ | 888 | /* Button filters */ |
880 | if (button != BUTTON_NONE && !(button & BUTTON_REL) | 889 | if (button != BUTTON_NONE && !(button & BUTTON_REL) |
881 | && !(button & (SYS_EVENT|BUTTON_MULTIMEDIA)) ) | 890 | && !(button & (SYS_EVENT|BUTTON_MULTIMEDIA)) ) |
882 | { | 891 | { |
892 | #ifdef HAVE_HARDWARE_CLICK | ||
893 | if (global_settings.keyclick) | ||
894 | { | ||
895 | system_sound_play(SOUND_KEYCLICK); | ||
896 | } | ||
897 | if (global_settings.keyclick_hardware) | ||
898 | { | ||
899 | #if !defined(SIMULATOR) | ||
900 | piezo_button_beep(false, false); | ||
901 | #endif | ||
902 | } | ||
903 | #else | ||
883 | system_sound_play(SOUND_KEYCLICK); | 904 | system_sound_play(SOUND_KEYCLICK); |
905 | #endif | ||
884 | } | 906 | } |
885 | } | 907 | } |
886 | } | 908 | } |