|
11 | 11 |
|
12 | 12 | public interface IKeyBinding |
13 | 13 | { |
14 | | - /** |
15 | | - * Resets the pressed state to whether or not the user is actually pressing |
16 | | - * this key on their keyboard. |
17 | | - */ |
18 | | - public default void resetPressedState() |
| 14 | + static IKeyBinding get(KeyMapping key) |
19 | 15 | { |
20 | | - wurst_resetPressedState(); |
| 16 | + return (IKeyBinding)key; |
21 | 17 | } |
22 | 18 |
|
23 | | - /** |
24 | | - * Simulates the user pressing this key on their keyboard or mouse. This is |
25 | | - * much more aggressive than using {@link #setPressed(boolean)} and should |
26 | | - * be used sparingly. |
27 | | - */ |
28 | | - public default void simulatePress(boolean pressed) |
| 19 | + default KeyMapping asVanilla() |
29 | 20 | { |
30 | | - wurst_simulatePress(pressed); |
| 21 | + return (KeyMapping)this; |
31 | 22 | } |
32 | 23 |
|
33 | | - public default void setPressed(boolean pressed) |
| 24 | + default void setPressed(boolean value) |
34 | 25 | { |
35 | | - asVanilla().setDown(pressed); |
| 26 | + asVanilla().setDown(value); |
36 | 27 | } |
37 | 28 |
|
38 | | - public default KeyMapping asVanilla() |
| 29 | + default boolean isPressed() |
39 | 30 | { |
40 | | - return (KeyMapping)this; |
| 31 | + return asVanilla().isDown(); |
| 32 | + } |
| 33 | + |
| 34 | + default void setDown(boolean value) |
| 35 | + { |
| 36 | + setPressed(value); |
41 | 37 | } |
42 | 38 |
|
43 | | - /** |
44 | | - * Returns the given KeyBinding object as an IKeyBinding, allowing you to |
45 | | - * access the resetPressedState() method. |
46 | | - */ |
47 | | - public static IKeyBinding get(KeyMapping kb) |
| 39 | + default boolean isDown() |
48 | 40 | { |
49 | | - return (IKeyBinding)kb; |
| 41 | + return isPressed(); |
50 | 42 | } |
51 | 43 |
|
52 | | - /** |
53 | | - * @deprecated Use {@link #resetPressedState()} instead. |
54 | | - */ |
55 | | - @Deprecated |
56 | | - public void wurst_resetPressedState(); |
| 44 | + void resetPressedState(); |
57 | 45 |
|
58 | | - /** |
59 | | - * @deprecated Use {@link #simulatePress()} instead. |
60 | | - */ |
61 | | - @Deprecated |
62 | | - public void wurst_simulatePress(boolean pressed); |
| 46 | + void simulatePress(boolean pressed); |
63 | 47 | } |
0 commit comments