diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java')
-rw-r--r-- | src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java | 62 |
1 files changed, 24 insertions, 38 deletions
diff --git a/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java b/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java index 4acfa1ccf2..164d1b8b37 100644 --- a/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java +++ b/src/main/java/gtPlusPlus/preloader/keyboard/BetterKeyboard.java @@ -1,58 +1,44 @@ /* - * Copyright (c) 2002-2008 LWJGL Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'LWJGL' nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright (c) 2002-2008 LWJGL Project All rights reserved. Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following conditions are met: * Redistributions of source code + * must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in + * binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived from this software without specific prior written + * permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package gtPlusPlus.preloader.keyboard; -import cpw.mods.fml.relauncher.FMLRelaunchLog; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.preloader.asm.transformers.ClassTransformer_LWJGL_Keyboard; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.util.HashMap; import java.util.Map; + import net.minecraft.client.resources.I18n; + import org.apache.logging.log4j.Level; import org.lwjgl.BufferUtils; import org.lwjgl.input.Keyboard; +import cpw.mods.fml.relauncher.FMLRelaunchLog; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.preloader.asm.transformers.ClassTransformer_LWJGL_Keyboard; + /** * <br> - * A raw Keyboard interface. This can be used to poll the current state of the - * keys, or read all the keyboard presses / releases since the last read. + * A raw Keyboard interface. This can be used to poll the current state of the keys, or read all the keyboard presses / + * releases since the last read. * * @author cix_foo <cix_foo@users.sourceforge.net> * @author elias_naur <elias_naur@users.sourceforge.net> * @author Brian Matzon <brian@matzon.dk> - * @version $Revision$ - * $Id$ + * @version $Revision$ $Id$ */ public class BetterKeyboard { @@ -127,6 +113,7 @@ public class BetterKeyboard { /** * Gets a key's name + * * @param key The key * @return a String with the key's human readable name in it or null if the key is unnamed */ @@ -138,8 +125,7 @@ public class BetterKeyboard { * Represents a key or mouse button as a string. Args: key */ public static String getKeyDisplayString(int aKeyValue) { - return aKeyValue < 0 - ? I18n.format("key.mouseButton", new Object[] {Integer.valueOf(aKeyValue + 101)}) + return aKeyValue < 0 ? I18n.format("key.mouseButton", new Object[] { Integer.valueOf(aKeyValue + 101) }) : getKeyName(aKeyValue); } } |