Re: Ctrl+Shift+V vs Ctrl+V. [message #405816] |
Thu, 18 February 2021 23:35 |
|
Originally posted by: Spiros Bousbouras
[Crossposting to alt.folklore.computers]
On Fri, 19 Feb 2021 02:38:50 -0000 (UTC)
Tom Furie <tom@furie.org.uk> wrote:
> On 2021-02-19, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
>> $ man ascii|grep 007
>> 007 7 07 BEL '\a' (bell) 107 71 47 G
>
>> But I still can't find the official documentation for the explanation of
>> the equivalence of ^G and '\a'. Any hints will be highly appreciated.
>
> G is the 7th letter, ^G represents "control code 7". The '\a' is for
> "alert", as '\b' is used for "backspace".
I was under the impression that it's because 7+64 = 71 .Obviously you get
the same result either way but I was under the impression that 64 has
something to do with it.
|
|
|
Re: Ctrl+Shift+V vs Ctrl+V. [message #413348 is a reply to message #405816] |
Sat, 19 February 2022 19:53 |
Alan Bowler
Messages: 185 Registered: July 2012
Karma: 0
|
Senior Member |
|
|
On 2021-02-18 11:35 p.m., Spiros Bousbouras wrote:
> [Crossposting to alt.folklore.computers]
>
> On Fri, 19 Feb 2021 02:38:50 -0000 (UTC)
> Tom Furie <tom@furie.org.uk> wrote:
>> On 2021-02-19, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
>>> $ man ascii|grep 007
>>> 007 7 07 BEL '\a' (bell) 107 71 47 G
>>
>>> But I still can't find the official documentation for the explanation of
>>> the equivalence of ^G and '\a'. Any hints will be highly appreciated.
>>
>> G is the 7th letter, ^G represents "control code 7". The '\a' is for
>> "alert", as '\b' is used for "backspace".
>
> I was under the impression that it's because 7+64 = 71 .Obviously you get
> the same result either way but I was under the impression that 64 has
> something to do with it.
It does. On combinatorial keyboards like teletypes and others
had CTRL toggled the 0100 (64) bit and SHIFT toggled the 0040 bit.
|
|
|
Re: Ctrl+Shift+V vs Ctrl+V. [message #413359 is a reply to message #413348] |
Tue, 22 February 2022 06:38 |
|
Originally posted by: Spiros Bousbouras
On Sat, 19 Feb 2022 19:53:09 -0500
Alan Bowler <atbowler@thinkage.ca> wrote:
> On 2021-02-18 11:35 p.m., Spiros Bousbouras wrote:
>> [Crossposting to alt.folklore.computers]
>>
>> On Fri, 19 Feb 2021 02:38:50 -0000 (UTC)
>> Tom Furie <tom@furie.org.uk> wrote:
>>> On 2021-02-19, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
>>>> $ man ascii|grep 007
>>>> 007 7 07 BEL '\a' (bell) 107 71 47 G
>>>
>>>> But I still can't find the official documentation for the explanation of
>>>> the equivalence of ^G and '\a'. Any hints will be highly appreciated.
>>>
>>> G is the 7th letter, ^G represents "control code 7". The '\a' is for
>>> "alert", as '\b' is used for "backspace".
>>
>> I was under the impression that it's because 7+64 = 71 .Obviously you get
>> the same result either way but I was under the impression that 64 has
>> something to do with it.
>
> It does. On combinatorial keyboards like teletypes and others
> had CTRL toggled the 0100 (64) bit and SHIFT toggled the 0040 bit.
On the 1 year anniversary of my post I get an answer ! Thank you.
|
|
|
Re: Ctrl+Shift+V vs Ctrl+V. [message #413361 is a reply to message #413359] |
Tue, 22 February 2022 17:03 |
|
Originally posted by: Fred Weigel
On Tuesday, February 22, 2022 at 6:38:22 AM UTC-5, Spiros Bousbouras wrote:
> On Sat, 19 Feb 2022 19:53:09 -0500
> Alan Bowler <atbo...@thinkage.ca> wrote:
>> On 2021-02-18 11:35 p.m., Spiros Bousbouras wrote:
>>> [Crossposting to alt.folklore.computers]
>>>
>>> On Fri, 19 Feb 2021 02:38:50 -0000 (UTC)
>>> Tom Furie <t...@furie.org.uk> wrote:
>>>> On 2021-02-19, hongy...@gmail.com <hongy...@gmail.com> wrote:
>>>> > $ man ascii|grep 007
>>>> > 007 7 07 BEL '\a' (bell) 107 71 47 G
>>>>
>>>> > But I still can't find the official documentation for the explanation of
>>>> > the equivalence of ^G and '\a'. Any hints will be highly appreciated.
>>>>
>>>> G is the 7th letter, ^G represents "control code 7". The '\a' is for
>>>> "alert", as '\b' is used for "backspace".
>>>
>>> I was under the impression that it's because 7+64 = 71 .Obviously you get
>>> the same result either way but I was under the impression that 64 has
>>> something to do with it.
>>
>> It does. On combinatorial keyboards like teletypes and others
>> had CTRL toggled the 0100 (64) bit and SHIFT toggled the 0040 bit.
> On the 1 year anniversary of my post I get an answer ! Thank you.^
But... that isn't it. There is no such equivalence. \a is alarm or alert -- t is tab; just easy to memorize. Yes, 7
is control-G, because G is 0x47... in ascii, anyway. Since C does NOT necessarily use ascii, \a may have a different value. To quote from the IBM C manual: "alert character
A character that in the output stream causes a terminal to alert its user by way of a visual or audible
notiĀ®ctionN The alert character is the character designated by a '\a' in the C and C++ languages. It is
unspeciĀ®ed whether this character is the exact sequence transmitted to an output device by the
system to accomplish the alert function."
|
|
|