mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-03-18 01:30:29 +00:00
Android key click preference for GL touch keyboard
This commit is contained in:
parent
c09fc33e98
commit
5b59e1c0c0
@ -350,9 +350,11 @@ public class Apple2Activity extends Activity {
|
||||
}
|
||||
|
||||
if ((nativeFlags & NATIVE_TOUCH_KEY_TAP) != 0) {
|
||||
AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
|
||||
if (am != null) {
|
||||
am.playSoundEffect(AudioManager.FX_KEY_CLICK);
|
||||
if (Apple2Preferences.KEYBOARD_CLICK_ENABLED.booleanValue(this)) {
|
||||
AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
|
||||
if (am != null) {
|
||||
am.playSoundEffect(AudioManager.FX_KEY_CLICK);
|
||||
}
|
||||
}
|
||||
|
||||
if ((apple2MenuView != null) && apple2MenuView.isCalibrating()) {
|
||||
|
@ -154,6 +154,30 @@ public class Apple2KeyboardSettingsMenu extends Apple2AbstractMenu {
|
||||
});
|
||||
}
|
||||
},
|
||||
KEYBOARD_ENABLE_CLICK {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.keyboard_click_enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getSummary(Apple2Activity activity) {
|
||||
return activity.getResources().getString(R.string.keyboard_click_enabled_summary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final Apple2Activity activity, View convertView) {
|
||||
convertView = _basicView(activity, this, convertView);
|
||||
CheckBox cb = _addCheckbox(activity, this, convertView, Apple2Preferences.KEYBOARD_CLICK_ENABLED.booleanValue(activity));
|
||||
cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
Apple2Preferences.KEYBOARD_CLICK_ENABLED.saveBoolean(activity, isChecked);
|
||||
}
|
||||
});
|
||||
return convertView;
|
||||
}
|
||||
},
|
||||
KEYBOARD_ENABLE_LOWERCASE {
|
||||
@Override
|
||||
public final String getTitle(Apple2Activity activity) {
|
||||
|
@ -571,6 +571,17 @@ public enum Apple2Preferences {
|
||||
public boolean booleanValue(Apple2Activity activity) {
|
||||
return activity.getPreferences(Context.MODE_PRIVATE).getBoolean(toString(), false);
|
||||
}
|
||||
},
|
||||
KEYBOARD_CLICK_ENABLED {
|
||||
@Override
|
||||
public void load(Apple2Activity activity) {
|
||||
boolean enabled = booleanValue(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean booleanValue(Apple2Activity activity) {
|
||||
return activity.getPreferences(Context.MODE_PRIVATE).getBoolean(toString(), true);
|
||||
}
|
||||
};
|
||||
|
||||
public enum HiresColor {
|
||||
|
@ -74,6 +74,8 @@
|
||||
<string name="keyboard">Keyboard</string>
|
||||
<string name="keyboard_choose_alt">Choose alt keyboard…</string>
|
||||
<string name="keyboard_choose_alt_summary">Choose alternative customized layout</string>
|
||||
<string name="keyboard_click_enabled">Enable key click</string>
|
||||
<string name="keyboard_click_enabled_summary">Enables key click sound if available</string>
|
||||
<string name="keyboard_configure">Configure keyboard…</string>
|
||||
<string name="keyboard_configure_summary">Transparency, lowercase, custom keys</string>
|
||||
<string name="keyboard_lowercase_enabled">Enable lowercase</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user