<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Why do you want to type control codes directly? It's a lot safer to use escape sequences.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-style-span">Bash even has a string quote form $'string', which supports escapes, and an escape <B>\c</B><SPAN class="Apple-style-span" style="text-decoration: underline;">x</SPAN> which stands for the control-<SPAN class="Apple-style-span" style="text-decoration: underline;">x</SPAN> character. This means you can represent the ^[ character as $'\c['.</SPAN></DIV><BR><DIV><DIV>On Nov 29, 2006, at 4:17 PM, Jacob Rus wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Rob McBroom wrote:</FONT></P> <BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">For shell init scripts and various other purposes, I'd like to be able to "type" characters like </FONT><FONT face="Lucida Grande" size="3" style="font: 12.0px Lucida Grande">⌃[ or ⌃G. You know, the kind of thing you would precede with ⌃V in the Terminal. It seems that Cocoa has a key binding for this (NSQuotedKeystrokeBinding, which is ⌃Q by default), but it is used for another purpose in Textmate. Has the functionality been remapped or do I need to try to define it for Textmate myself? It doesn't seem to be set…</FONT></P> </BLOCKQUOTE><P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande; min-height: 15.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Lucida Grande" size="3" style="font: 12.0px Lucida Grande">I'm pretty sure TextMate's text control doesn't support that, but you can try.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande; min-height: 15.0px"><BR></P> <BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Lucida Grande" size="3" style="font: 12.0px Lucida Grande"><SPAN class="Apple-converted-space">    </SPAN>rob@kendra ~> defaults read com.macromates.Textmate NSQuotedKeystrokeBinding</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Lucida Grande" size="3" style="font: 12.0px Lucida Grande"><SPAN class="Apple-converted-space">    </SPAN>2006-11-29 14:47:10.910 defaults[6713]</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Lucida Grande" size="3" style="font: 12.0px Lucida Grande"><SPAN class="Apple-converted-space">    </SPAN>The domain/default pair of (com.macromates.Textmate, NSQuotedKeystrokeBinding) does not exist</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Lucida Grande" size="3" style="font: 12.0px Lucida Grande">On a related note, I'd like to be able to "see" these characters as well, or perhaps toggle them of and on (with ⌥⌘I ideally). Texmate is better than most Cocoa apps, as it seems to display a space in place of such characters instead of nothing at all, but I'd like to know what that space represents. Has anyone tried enabling [NSTextShowsControlCharacters][] in Textmate? I'm guessing there would be undesired side-effects.</FONT></P> </BLOCKQUOTE><P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande; min-height: 15.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Lucida Grande" size="3" style="font: 12.0px Lucida Grande">Did you try showing invisibles?<SPAN class="Apple-converted-space">  </SPAN>I believe these show up as different from spaces or tabs, but I don't remember exactly what they look like.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Lucida Grande; min-height: 15.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Lucida Grande" size="3" style="font: 12.0px Lucida Grande">In any case, you should be able to copy/paste them into a textmate control from another window, or make a command to insert them, something that takes the previous letter ("[" for instance), and turns it into the control sequence ("⌃[").</FONT></P> </BLOCKQUOTE></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Kevin Ballard</DIV><DIV><A href="http://kevin.sb.org">http://kevin.sb.org</A></DIV><DIV><A href="mailto:kevin@sb.org">kevin@sb.org</A></DIV><DIV><A href="http://www.tildesoft.com">http://www.tildesoft.com</A></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>