Modify a key according to modifiers.
(KeyValue k, Pointers.Modifiers mods)
| 16 | |
| 17 | /** Modify a key according to modifiers. */ |
| 18 | public static KeyValue modify(KeyValue k, Pointers.Modifiers mods) |
| 19 | { |
| 20 | if (k == null) |
| 21 | return null; |
| 22 | int n_mods = mods.size(); |
| 23 | KeyValue r = k; |
| 24 | for (int i = 0; i < n_mods; i++) |
| 25 | r = modify(r, mods.get(i)); |
| 26 | /* Keys with an empty string are placeholder keys. */ |
| 27 | if (r.getString().length() == 0) |
| 28 | return null; |
| 29 | return r; |
| 30 | } |
| 31 | |
| 32 | /** Like [modify] but do not apply user modmaps. Used when evaluating macros |
| 33 | to avoid loops. */ |