MCPcopy Create free account
hub / github.com/Julow/Unexpected-Keyboard / apply_shift

Method apply_shift

srcs/juloo.keyboard2/KeyModifier.java:213–236  ·  view source on GitHub ↗
(KeyValue k)

Source from the content-addressed store, hash-verified

211 }
212
213 private static KeyValue apply_shift(KeyValue k)
214 {
215 if (_modmap != null)
216 {
217 KeyValue mapped = _modmap.get(Modmap.M.Shift, k);
218 if (mapped != null)
219 return mapped;
220 }
221 KeyValue r = ComposeKey.apply(ComposeKeyData.shift, k);
222 if (r != null)
223 return r;
224 switch (k.getKind())
225 {
226 case Char:
227 char kc = k.getChar();
228 char c = Character.toUpperCase(kc);
229 return (kc == c) ? k : k.withChar(c);
230 case String:
231 String ks = k.getString();
232 String s = Utils.capitalize_string(ks);
233 return s.equals(ks) ? k : KeyValue.makeStringKey(s, k.getFlags());
234 default: return k;
235 }
236 }
237
238 private static KeyValue apply_fn(KeyValue k)
239 {

Callers 2

modifyMethod · 0.95
apply_gestureMethod · 0.95

Calls 10

applyMethod · 0.95
capitalize_stringMethod · 0.95
makeStringKeyMethod · 0.95
getKindMethod · 0.80
getCharMethod · 0.80
withCharMethod · 0.80
getStringMethod · 0.80
getFlagsMethod · 0.80
getMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected