Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check iPhone keyboard klick sound turned on/off in settings?

Tags:

iphone

I'm working on custom keyboard and need to play tap sound for keys if it enabled in the Settings. Tap sound not a problem but how to check is keyboard click sound enabled ? Thanks.

like image 849
Newbee Avatar asked Apr 24 '10 10:04

Newbee


1 Answers

There's no documented way to check this, but it's possible. I don't know if this really counts as "private API", so be prepared for rejection if you use this method.

The keyboard click sound settings is stored in the shared com.apple.preferences.sounds preference. So you could try

return CFPreferencesGetAppBooleanValue(
        CFSTR("keyboard"),
        CFSTR("/var/mobile/Library/Preferences/com.apple.preferences.sounds"),
        NULL);

(BTW: the actual call to play the "click" sound in UIKit is [UIHardware _playSystemSound:1104];)

like image 75
kennytm Avatar answered Oct 23 '22 03:10

kennytm