2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

OSX ショートカットキー入力の際Beep音を鳴らさない方法

Last updated at Posted at 2017-05-10

背景

ユーザーによる任意のショートカットキー(ホットキー)設定を実装しようとした際、アルファベットや記号などの入力(KeyDownイベント)ではBeep音が鳴らないが、Command + A や Shift + B のように修飾キーを伴った入力を行うとBeep音が鳴ってしまった。何が原因なのかわからずBeep音が消せない状態が長引き困ったため解決方法をここにまとめておく。

解決方法

キー入力を受け付けるViewや要素の中で以下のメソッドをoverrideして返り値にtrueを設定すれば良い。

override func performKeyEquivalent(with event: NSEvent) -> Bool {
	return true;
}
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?