How does Ctrl+Q in the Editor work?

Хотите говорить о Far и не знаете, куда обратиться?
Post Reply
DV
Posts: 455
Joined: Mon 07 Aug, 2006 08:23
Has thanked: 31 times
Been thanked: 15 times

How does Ctrl+Q in the Editor work?

Post by DV »

The documentation says:
"Ctrl+Q Treat the next key combination as a character code"

Guys, could you provide some examples in the built-in help to demonstrate how it works? Is it expecting a hexadecimal character code? Octal? Decimal? How many characters is it expecting to form a character code? Should I hold the Ctrl key or release it while typing a character code?
I tried:
  1. Ctrl+Q pressed, then pressed some numbers. The result: nothing.
  2. Ctrl+Q pressed, then pressed some numbers while holding Ctrl. The result: nothing.
  3. Ctrl+Q pressed, then some character from A to Z while holding Ctrl. For example: pressing Ctrl+Q, holding Ctrl, pressing M. Result: the '\r' character appears. Is it expected?
Last edited by DV on Tue 06 Jun, 2023 09:00, edited 1 time in total.
2useven10
Posts: 5211
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 310 times

How does Ctrl+Q in the Editor work?

Post by 2useven10 »

(3) Is expected one character

To use decimal character code (unicode):
Hold Alt key and enter decimal character code on numeric pad than release Alt
Last edited by 2useven10 on Tue 06 Jun, 2023 11:47, edited 2 times in total.
User avatar
HaRT
Moderator
Posts: 10823
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 221 times
Been thanked: 358 times

How does Ctrl+Q in the Editor work?

Post by HaRT »

DV wrote: Tue 06 Jun, 2023 08:57 pressing Ctrl+Q, holding Ctrl, pressing M. Result: the '\r' character appears. Is it expected?
Yes. Likewise, Ctrl+Q Ctrl+J will produce LF (\n), etc. But these characters (except TAB) are not interpreted in a special manner until you reopen the file.
DV wrote: Tue 06 Jun, 2023 08:57 provide some examples in the built-in help to demonstrate how it works
I agree that it would be useful.

P.S. Please note that Ctrl+Q works the same in dialog text edit controls.
Фар есть инструмент, а не нянька. © 2009 DrKnS
DV
Posts: 455
Joined: Mon 07 Aug, 2006 08:23
Has thanked: 31 times
Been thanked: 15 times

How does Ctrl+Q in the Editor work?

Post by DV »

Hmm... What is the connection between Ctrl+J and '\n'? Is there some character mapping table for this?
I mean, I could understand e.g. Ctrl+R -> '\r' and Ctrl+N -> '\n', but as it's not the case, what is the actual mapping?
Last edited by DV on Tue 06 Jun, 2023 13:23, edited 1 time in total.
User avatar
DrKnS
Posts: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

How does Ctrl+Q in the Editor work?

Post by DrKnS »

Post Reply

Return to “Обсуждение Far Manager”