Input.java
2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* This file is part of LiteLoader.
* Copyright (C) 2012-16 Adam Mummery-Smith
* All Rights Reserved.
*/
package com.mumfrey.liteloader.util;
import com.mumfrey.liteloader.api.CoreProvider;
import com.mumfrey.liteloader.core.LiteLoaderMods;
import com.mumfrey.liteloader.util.jinput.ComponentRegistry;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.network.INetHandler;
import net.minecraft.network.play.server.SPacketJoinGame;
import net.minecraft.world.World;
public abstract class Input implements CoreProvider
{
/**
* Register a key for a mod
*
* @param binding
*/
public abstract void registerKeyBinding(KeyBinding binding);
/**
* Unregisters a registered keybind with the game settings class, thus
* removing it from the "controls" screen.
*
* @param binding
*/
public abstract void unRegisterKeyBinding(KeyBinding binding);
/**
* Writes mod bindings to disk
*/
public abstract void storeBindings();
/**
* Gets the underlying JInput component registry
*/
public abstract ComponentRegistry getComponentRegistry();
/**
* Returns a handle to the event described by descriptor (or null if no
* component is found matching the descriptor. Retrieving an event via this
* method adds the controller (if found) to the polling list and causes it
* to raise events against the specified handler.
*
* <p>This method returns an {@link InputEvent} which is passed as an
* argument to the relevant callback on the supplied handler in order to
* identify the event. For example:</p>
*
* <code>this.joystickButton = input.getEvent(descriptor, this);</code>
*
* <p>then in onAxisEvent</p>
*
* <code>if (source == this.joystickButton) // do something with button
* </code>
*
* @param descriptor
* @param handler
*/
public abstract InputEvent getEvent(String descriptor, InputHandler handler);
/**
* Get events for all components which match the supplied descriptor
*
* @param descriptor
* @param handler
*/
public abstract InputEvent[] getEvents(String descriptor, InputHandler handler);
@Override
public void onPostInitComplete(LiteLoaderMods mods)
{
}
@Override
public void onStartupComplete()
{
}
@Override
public void onJoinGame(INetHandler netHandler, SPacketJoinGame loginPacket)
{
}
@Override
public void onWorldChanged(World world)
{
}
@Override
public void onPostRender(int mouseX, int mouseY, float partialTicks)
{
}
}