1

テキスト コントロールで fn キーを 2 回押すと、Mountain Lion ディクテーション機能がデフォルトで呼び出されます。

ボタンクリックイベントの後に呼び出すなど、他のコントロールやイベントから同じ機能を呼び出すことができるかどうかを知りたいです。

Mountain lion が提供するデフォルトのディクテーション機能をアプリケーションで使用したいと考えています。私のクロス プラットフォーム アプリケーション (wxWidgets) には、wxControl から派生したエディターがあります。このエディターには、この口述機能を呼び出すための既定の動作がありません。代わりにデフォルトのテキスト コントロールを使用すると、この機能は正常に動作します。

提案してください。

ありがとう

4

1 に答える 1

0

次のようなことを試すことができます:

NSAppleScript *scriptForCMDKey = [[NSAppleScript alloc] initWithSource:@"tell application \"System Events\"\nset theProcess to first process whose frontmost is true\ntell theProcess\nrepeat 2 times\nkey down {command}\nkey up {command}\nend repeat\nend tell\nend tell"];
[scriptForCMDKey executeAndReturnError:nil];

NSAppleScript *scriptForFNKey = [[NSAppleScript alloc] initWithSource:@"tell application \"System Events\"\nset theProcess to first process whose frontmost is true\ntell theProcess\nrepeat 2 times\nkey code 63\nkey code 63\nend repeat\nend tell\nend tell"];
[scriptForFNKey executeAndReturnError:nil];
于 2013-07-24T11:40:33.560 に答える