Invalid key code @ java

后端 未结 3 1388
情话喂你
情话喂你 2020-12-18 16:40

I\'m working on a system to type things automatically with java. This is how I write it:

public void typeMessage(String message) {
    for (char c : message.         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-18 17:33

    Your keyboard layout should have a key for the @ symbol for this code to work. Does it?

    If your keyboard is set up with an American layout you need to type shift+2 to type an @ symbol, and instead of VK_AT you have to use VK_2.

提交回复
热议问题