With Objective-C I can simple make it. [button setKeyEquivalent:"\E"]; However swift doesn’t allow me to do that. button.keyEquivalent = "\E" Then I got "Invalid escape sequence in literal". Is there any solution?