标签:inf shift span scene mon tps btn 按钮 mic
1 KeyCombination kc1 = new KeyCodeCombination(KeyCode.ENTER,KeyCombination.CONTROL_DOWN);//快捷键:ctrl+enter,第一种 2 KeyCombination kc2 = new KeyCharacterCombination("ENTER",KeyCombination.CONTROL_DOWN);//快捷键:ctrl+enter,第二种 3 Mnemonic mc1= new Mnemonic(btn_send,kc1); 4 scene.addMnemonic(mc1); 5 6 KeyCombination kc3 = new KeyCodeCombination(KeyCode.ENTER,KeyCombination.SHIFT_DOWN);//快捷键:ctrl+enter,第三种 7 scene.getAccelerators().put(kc3, new Runnable(){ 8 public void run(){ 9 //按钮事件 10 } 11 });
其中,快捷键的绑定,是通过KeyCombination();里面可以有多个参数。
建议使用第三种方法去绑定快捷键。
标签:inf shift span scene mon tps btn 按钮 mic
原文地址:https://www.cnblogs.com/jdr-gbl/p/12059411.html