Home > Archive > Tcl > June 2007 > How does one place special characters into a stream
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How does one place special characters into a stream
|
|
| Andrew Falanga 2007-06-08, 10:11 pm |
| Hi,
I have a situation where I'm trying to place the characters "ctrl" +
"shift" + "-" on a socket or serial port. How would I do that? I saw
a reply post in here, last w I think, that mentioned the
traditional way of doing "Ctrl" + "<char>" is: \037 & <char>, but
what am I going to do with the shift in there too?
Andy
| |
| billposer@alum.mit.edu 2007-06-08, 10:11 pm |
| On Jun 8, 11:19 am, Andrew Falanga <af300...@gmail.com> wrote:
> Hi,
>
> I have a situation where I'm trying to place the characters "ctrl" +
> "shift" + "-" on a socket or serial port. How would I do that? I saw
> a reply post in here, last w I think, that mentioned the
> traditional way of doing "Ctrl" + "<char>" is: \037 & <char>, but
> what am I going to do with the shift in there too?
>
> Andy
"shift" is not a character - it is a keypress. Your window system and
kernel in some combination map sequences of keypresses onto sequences
of characters, e.g. "shift" + "a" onto "A". So if you are dealing with
character streams, you need to find out what characters "ctrl" +
"shift" + "-" represents and send that character sequence. If you
really need to transmit the shift, you are dealing with event
sequences not characters.
| |
| Andrew Falanga 2007-06-08, 10:11 pm |
| > "shift" is not a character - it is a keypress. Your window system and
> kernel in some combination map sequences of keypresses onto sequences
> of characters, e.g. "shift" + "a" onto "A". So if you are dealing with
> character streams, you need to find out what characters "ctrl" +
> "shift" + "-" represents and send that character sequence. If you
> really need to transmit the shift, you are dealing with event
> sequences not characters.
Thank you. That makes a lot of sense. Especially, considering that I
could find no value for shift in the ASCII chart.
Andy
| |
| Melissa Schrumpf 2007-06-08, 10:11 pm |
| Andrew Falanga wrote:
[color=darkred]
> Thank you. That makes a lot of sense. Especially, considering that I
> could find no value for shift in the ASCII chart.
You may want to have a quick read of the RFB specification, and then
check out:
http://www.ifost.org.au/Software/tkvnc/index.html
--
MKS
| |
| Frank Ranner 2007-06-09, 4:12 am |
| On Fri, 08 Jun 2007 11:19:07 -0700, Andrew Falanga wrote:
> Hi,
>
> I have a situation where I'm trying to place the characters "ctrl" +
> "shift" + "-" on a socket or serial port. How would I do that? I saw
> a reply post in here, last w I think, that mentioned the
> traditional way of doing "Ctrl" + "<char>" is: \037 & <char>, but
> what am I going to do with the shift in there too?
>
> Andy
If you are on a linux box you can use 'man ascii' to get character info.
For example, ctrl + shft + '-' (which is really ctrl + _) is listed like
so:
Oct Dec Hex Char Oct Dec Hex Char
------------------------------------------------------------------------
snip
034 28 1C FS (file separator) 134 92 5C \ '\'
035 29 1D GS (group separator) 135 93 5D ]
036 30 1E RS (record separator) 136 94 5E ^
037 31 1F US (unit separator) 137 95 5F _
040 32 20 SPACE 140 96 60 `
snip
This shows that _ is hex 5F, and ctrl-_ is hex 1F
regards
Frank Ranner
| |
|
|
|
|
|