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

Method parse

srcs/juloo.keyboard2/ExtraKeys.java:122–134  ·  view source on GitHub ↗

Extra keys are of the form "key name" or "key name:alt1:alt2@next_to".

(String str, String script)

Source from the content-addressed store, hash-verified

120
121 /** Extra keys are of the form "key name" or "key name:alt1:alt2@next_to". */
122 public static ExtraKey parse(String str, String script)
123 {
124 String[] split_on_at = str.split("@", 2);
125 String[] key_names = split_on_at[0].split(":");
126 KeyValue kv = KeyValue.getKeyByName(key_names[0]);
127 KeyValue[] alts = new KeyValue[key_names.length-1];
128 for (int i = 1; i < key_names.length; i++)
129 alts[i-1] = KeyValue.getKeyByName(key_names[i]);
130 KeyValue next_to = null;
131 if (split_on_at.length > 1)
132 next_to = KeyValue.getKeyByName(split_on_at[1]);
133 return new ExtraKey(kv, script, Arrays.asList(alts), next_to);
134 }
135 }
136
137 public final static class Query

Callers 1

parseMethod · 0.95

Calls 1

getKeyByNameMethod · 0.95

Tested by

no test coverage detected