MCPcopy Index your code
hub / github.com/processing/processing / getKeyStrokeExt

Method getKeyStrokeExt

app/src/processing/app/ui/Toolkit.java:130–153  ·  view source on GitHub ↗

Return the correct KeyStroke per locale and platform. Also checks for any additional overrides in preferences.txt. @param base the localization key for the menu item (.keystroke and .platform will be added to the end) @return KeyStroke for base + .keystroke + .platform (or the va

(String base)

Source from the content-addressed store, hash-verified

128 * (or the value from preferences) or null if none found
129 */
130 static public KeyStroke getKeyStrokeExt(String base) {
131 String key = base + ".keystroke";
132
133 // see if there's an override in preferences.txt
134 String sequence = Preferences.get(key);
135 if (sequence != null) {
136 KeyStroke ks = KeyStroke.getKeyStroke(sequence);
137 if (ks != null) {
138 return ks; // user did good, we're all set
139
140 } else {
141 System.err.format(BAD_KEYSTROKE, sequence);
142 }
143 }
144
145 sequence = Language.text(key + "." + Platform.getName());
146 KeyStroke ks = KeyStroke.getKeyStroke(sequence);
147 if (ks == null) {
148 // this can only happen if user has screwed up their language files
149 System.err.format(BAD_KEYSTROKE, sequence);
150 //return KeyStroke.getKeyStroke(0, 0); // badness
151 }
152 return ks;
153 }
154
155
156 /**

Callers 2

newJMenuItemExtMethod · 0.95
buildEditMenuMethod · 0.95

Calls 4

getMethod · 0.95
textMethod · 0.95
getNameMethod · 0.95
formatMethod · 0.65

Tested by

no test coverage detected