0

How would you simulate the keystroke ö on Mac OS X programmatically?

This isn't just a randomly chosen character, I know you can simulate all ASCII characters as well as some special ones like Esc, Backspace, etc using either an embedded Applescript or CGEventCreateKeyboardEvent. But what about all those keys for which a CGKeyCode isn't defined? There must be a way!

4

1 回答 1

2

您需要使用 CGEventSetFlags 来设置 'u' 击键的选项修饰符,然后是向上键事件,然后是 'o' 击键。

https://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html

如果您需要更多信息,请询问,我将创建一些代码示例

于 2012-09-22T19:22:08.753 回答