1
我正在嘗試構建視頻播放器。在這我想尋求媒體使用Ctrl和LEFT和RIGHT鍵。JavaFX KeyCodeCombination Control + LEFT或Ctrl + RIGHT鍵
我試過兩種方式:
KeyCombination.keyCombination("Ctrl+RIGHT").match(e);
和
KeyCodeCombination(KeyCode.LEFT, KeyCombination.CONTROL_DOWN).match(e);
其他鍵組合工作,但這些都沒有。
有什麼辦法可以實現嗎?
是的,我可以用,但我不想。我特別想使用'Control + LEFT'。您可以在VLC Player和KMPlayer上看到用戶可以使用這些組合鍵來查找媒體。 順便問一下,你能告訴我哪一個是快捷鍵嗎?我試圖使用您提供的組合鍵,但我無法實現。我正在使用Windows 8.1操作系統。 –
快捷方式是Windows上的控制鍵。你現在可以發佈你的?幫助會容易得多。 – DVarga
這是 - '如果(keyCombinationControlRight.match(E)||新KeyCodeCombination(KeyCode.RIGHT,KeyCombination.SHORTCUT_DOWN).match(E)){ \t \t \t \t通信System.err.println(「CTRL + RIGHT 「); (newPost.getCurrentTime()。toMillis()+ longSeekTime.toMillis())); \t \t \t} \t \t \t否則,如果(keyCombinationControlLeft.match(E)||新KeyCodeCombination(KeyCode.LEFT,KeyCombination.SHORTCUT_DOWN).match(E)) \t \t \t { \t \t \t \t System.err的.println( 「CTRL + LEFT」); ());}};}}};}}};}}};}} mediaPlayer.seek(newPeerPlayer.getCurrentTime()。toMillis() - longSeekTime.toMillis())); \t \t \t} ' –