Cocoa: Simulate Macbook upper keys & Multimedia keys

后端 未结 2 831
别那么骄傲
别那么骄傲 2020-12-31 12:55

I am trying to simulate the upper Macbook keys to any active app using

CGEventCreateKeyboardEvent (NULL, (CGKeyCode)keycode, true);
CGEventCreateKeyboardEven         


        
2条回答
  •  忘掉有多难
    2020-12-31 13:28

    Media keys are not treated as normal keyboard events, for some reason. This post shows what the events look like.

提交回复
热议问题