我有問題通過java機器人類按特殊字母(土耳其等)。我有一種方法來按鍵作爲alt +鍵碼。我不能將一些特殊的字母轉換爲當前的鍵碼。那我該如何解決它。感謝名單Java機器人類按土耳其語字母(Ö,ö,Ş,ş,Ü,ü,Ğ,?,İ,ı,Ç,ç,Ə,ə)?
例如:
KeyStroke ks = KeyStroke.getKeyStroke('ö', 0);
System.out.println(ks.getKeyCode());
Output : 246
// So alt+0246='ö'
//but if I convert 'ş' to keycode
//Output is 351 . So alt+351= '_' and alt+0351= '_'
//What is the Correct combination for 'ş'. same for 'Ş', 'ş','Ğ', 'ğ', 'İ', 'ı', 'Ə', 'ə'
按鍵:
public void altNumpad(int... numpadCodes) {
if (numpadCodes.length == 0) {
return;
}
robot.keyPress(VK_ALT);
for (int NUMPAD_KEY : numpadCodes) {
robot.keyPress(NUMPAD_KEY);
robot.keyRelease(NUMPAD_KEY);
}
robot.keyRelease(VK_ALT);
}
這些字符是否在BMP之外? – fge
從[此鏈接](http://www.fileformat.info/info/unicode/char/015f/index.htm),似乎在Windows下您應該使用Alt + 015F。我沒有Windows,所以我無法測試... – fge
不起作用。謝謝 – Bertrand