java keyboard_Java Keyboard.KEY_NUMPAD2属性代码示例

public TimelineKeyMappings(TimelineController controller)

{

this.controller = controller;

keyMappings = new KeyMapping(controller.timelineFrame);

keyMappings.addKey(KeyEvent.VK_SPACE, Keyboard.KEY_SPACE, "spacePressed", new SpaceAction());

keyMappings.addKey(KeyEvent.VK_W, Keyboard.KEY_W, "wPressed", new WAction());

keyMappings.addKey(KeyEvent.VK_S, Keyboard.KEY_S, "sPressed", new SAction());

keyMappings.addKey(KeyEvent.VK_A, Keyboard.KEY_A, "aPressed", new AAction());

keyMappings.addKey(KeyEvent.VK_D, Keyboard.KEY_D, "dPressed", new DAction());

keyMappings.addCtrlKey(KeyEvent.VK_Z, Keyboard.KEY_Z, "undoReleased", new UndoAction());

keyMappings.addCtrlKey(KeyEvent.VK_Y, Keyboard.KEY_Y, "redoReleased", new RedoAction());

keyMappings.addKey(KeyEvent.VK_ESCAPE, Keyboard.KEY_ESCAPE, "escPressed", new EscAction());

keyMappings.addKey(KeyEvent.VK_DELETE, Keyboard.KEY_DELETE, "deletePressed", new DeleteAction());

keyMappings.addCtrlKey(KeyEvent.VK_R, Keyboard.KEY_R, "rPressed", new ResetAction());

keyMappings.addCtrlKey(KeyEvent.VK_C, Keyboard.KEY_C, "cPressed", new CopyAction());

keyMappings.addCtrlKey(KeyEvent.VK_V, Keyboard.KEY_V, "vPressed", new PasteAction());

keyMappings.addCtrlShiftKey(KeyEvent.VK_ADD, Keyboard.KEY_ADD, "addAllPressed", new AddAction(true));

keyMappings.addCtrlShiftKey(KeyEvent.VK_SUBTRACT, Keyboard.KEY_SUBTRACT, "removeAllPressed", new RemoveAction(true));

keyMappings.addCtrlKey(KeyEvent.VK_ADD, Keyboard.KEY_ADD, "addPressed", new AddAction(false));

keyMappings.addCtrlKey(KeyEvent.VK_SUBTRACT, Keyboard.KEY_SUBTRACT, "removePressed", new RemoveAction(false));

int[] numpadKey = new int[] {

Keyboard.KEY_NUMPAD0, Keyboard.KEY_NUMPAD1, Keyboard.KEY_NUMPAD2, Keyboard.KEY_NUMPAD3,

Keyboard.KEY_NUMPAD4, Keyboard.KEY_NUMPAD5, Keyboard.KEY_NUMPAD6, Keyboard.KEY_NUMPAD7,

Keyboard.KEY_NUMPAD8, Keyboard.KEY_NUMPAD9};

for (int j = 0; j <= 9; j++)

{

keyMappings.addKey(KeyEvent.VK_NUMPAD0 + j, numpadKey[j], "numpad" + j, new ChangeViewAction(j));

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值