SendInput() not equal to pressing key manually on keyboard in C++?

前端 未结 3 1644
时光取名叫无心
时光取名叫无心 2020-11-28 08:55

I wanted to write a c++ code to emulate pressing a keyboard key \"A\":

// Set up a generic keyboard event.
ip.type = INPUT_KEYBOARD;
ip.ki.wScan = 0; // hard         


        
3条回答
  •  自闭症患者
    2020-11-28 09:28

    If you are looking to create a game bot, have you looked at the program AutoHotKey? http://www.autohotkey.com/

    It offers a scripting language, that allows you to do a lot of the tasks involved in 'bot' creation and it's rather easier than trying to do it all in C++

    (It certainly played Farmville for me, when all my family pressured me into creating an account)

提交回复
热议问题