Package com.threerings.util

Examples of com.threerings.util.KeyTranslatorImpl


    /**
     * Returns a key translator configured with basic puzzle game mappings.
     */
    public static KeyTranslatorImpl getKeyTranslator ()
    {
        KeyTranslatorImpl xlate = new KeyTranslatorImpl();

        if (!PuzzlePanel.isRobotTesting()) {
            // add the standard pause keys
            xlate.addPressCommand(KeyEvent.VK_P, PuzzleController.TOGGLE_CHATTING);
        }

        return xlate;
    }
View Full Code Here


     * Returns a key translator configured with mappings suitable for a drop puzzle game.
     */
    public static KeyTranslatorImpl getKeyTranslator ()
    {
        // start with the standard puzzle key mappings
        KeyTranslatorImpl xlate = PuzzleGameUtil.getKeyTranslator();

        // add all press key mappings
        xlate.addPressCommand(KeyEvent.VK_LEFT,
                              DropControllerDelegate.MOVE_BLOCK_LEFT, MOVE_RATE, MOVE_DELAY);
        xlate.addPressCommand(KeyEvent.VK_RIGHT,
                              DropControllerDelegate.MOVE_BLOCK_RIGHT, MOVE_RATE, MOVE_DELAY);
        xlate.addPressCommand(KeyEvent.VK_UP, DropControllerDelegate.ROTATE_BLOCK_CCW, 0);
        xlate.addPressCommand(KeyEvent.VK_DOWN, DropControllerDelegate.ROTATE_BLOCK_CW, 0);
        xlate.addPressCommand(KeyEvent.VK_SPACE, DropControllerDelegate.START_DROP_BLOCK, 0);

        // add all release key mappings
        xlate.addReleaseCommand(KeyEvent.VK_SPACE, DropControllerDelegate.END_DROP_BLOCK);

        return xlate;
    }
View Full Code Here

TOP

Related Classes of com.threerings.util.KeyTranslatorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.