1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
12 import javax
.microedition
.lcdui
.Canvas
;
13 import javax
.microedition
.lcdui
.Display
;
16 * Tests that the standard key codes do in fact map to game keys.
20 public class TestCanvasStandardKeyCodes
28 public void test(Display __display
, CanvasPlatform __platform
)
30 // Set bits within the mask
32 for (int i
= Canvas
.KEY_SELECT
; i
<= Canvas
.KEY_DELETE
; i
++)
35 int gameKey
= __platform
.getGameAction(i
);
40 gameKeyMask
|= (1 << gameKey
);
42 catch (IllegalArgumentException ignored
)
46 // There should have been all the game keys in this
47 this.secondary("mask", gameKeyMask
);