[swift-users] How can I set NSButton's keyEquivalent to the Escape key?

somu subscribe somu.subscribe at gmail.com
Thu Nov 2 19:17:07 CDT 2017


Or you could try "\\E"

Thanks and regards,
Muthu

> On 3 Nov 2017, at 12:01 AM, C. Keith Ray via swift-users <swift-users at swift.org> wrote:
> 
> try  "\u{1b}"
> 
> --
> C. Keith Ray
> Senior Software Engineer / Trainer / Agile Coach
> * http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf <http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf>
> 
> 
> 
>> On Nov 2, 2017, at 8:39 AM, 李某某 via swift-users <swift-users at swift.org <mailto:swift-users at swift.org>> wrote:
>> 
>> 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?
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org <mailto:swift-users at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171103/3357e4d4/attachment.html>


More information about the swift-users mailing list