Can we type NUL character (HEX 0) from the keyboard?
Most of the printable character starts from HEX value 20.
Ctrl+spacebar works for both Windows and Linux platforms.
See if this control character works:
Ctrl+#
According to Wikipedia
Ctrl+SPACE
works on many terminals (worked for me).
Press and hold Alt and type Num Pad 0Num Pad 0Num Pad 0 then release Alt
Note: You must use the 0 key on the numeric key pad (a regular 0 key won't work for this), and you have to hold down Alt the whole time. The keystroke isn't emitted until you release the Alt key.
In editing fields in SQL Server, it is Control Zero (Ctrl + 0)
Related
I have a TDrawGrid where I am using its OnDrawCell event, and in there the Canvas.TextRect() method is used to fill out the cells with strings. One of the strings contains an &, but it gets displayed as an underscore _.
I don't see anything wrong, there is nothing fancy with this grid, and elsewhere it seems to work fine. Also the debugger confirms that the string is correct when passing it to Canvas.TextRect().
What am I missing?
Delphi 11, 64-bit, Windows 11.
This is expected. In Microsoft Windows, menu items, buttons, and control labels use an underscore to indicate the corresponding keyboard shortcut, and this underlined character is indicated using a prefix ampersand in code.
For instance, the &File menu item (displayed as File with F underlined) can be accessed by pressing Alt+F. A &Save button (displayed as Save with S underlined) may be invoked by pressing Alt+S (or only S if the currently focused control doesn't accept character input). You can set focus to a text field with label &Name: (displayed as Name: with N underlined) by pressing Alt+N.
This is why a string like Lost & Found is displayed as Lost _Found in Windows.
If you don't want ampersands to be treated as accelerator character indicators, simply use the tfNoPrefix flag:
Canvas.TextRect(R, S, [tfNoPrefix])
This VCL flag corresponds to the Win32 API DT_NOPREFIX flag:
Turns off processing of prefix characters. Normally, DrawText interprets the mnemonic-prefix character & as a directive to underscore the character that follows, and the mnemonic-prefix characters && as a directive to print a single &. By specifying DT_NOPREFIX, this processing is turned off.
I'm trying to define custom characters on thermal printer NCR 7199.
I used ESC/POS command
ESC & y c1 c2 x d1...dn
and it works fine. But this command can change only characters in range 32-126, and those characters are latin letters and common symbols.
I'd prefer to replace characters with codes 8E-8F, for example, but cannot do it using this command.
Is it possible? Or is there any other ESC/POS command for user-defined characters?
UPD.
It seems like a firmware update can fix this problem. Firmware version on our printer is v99.21, and I saw this in release notes:
v99.25 "based on v99.24"
1. Allowed User-defined characters defined range from 20H to FFH in 7199 Emulation mode
Another user-defined character setting command for Kanji is for printers that support the MBCS character set, which is not what you want.
FS 2
Define user-defined Kanji characters
However, although it is unclear whether NCR 7199 supports it, ESC/POS has the ability to customize the font of the user-defined code page rather than the individual characters.
Please refer to the contents of the following pages.
GS ( E <Function 7>
Copy the user-defined page
GS ( E <Function 8>
Define the data (column format) for the character code page
GS ( E <Function 9>
Define the data (raster format) for the character code page
GS ( E <Function 10>
Delete the data for the character code page
Problem solved by updating firmware.
After updating "Main Firmware" to v99.27 (it seems that version must be greater or equal v99.25) and changing Emulation mode to "NCR 7199" I was finally able to define characters in all range 20-FF.
I need to be able to print Hebrew characters on my Epson TM-T20ii. I am trying to get my printer to switch to character code page 36(PC862) using
ESC t36
for some reason the printer is switching to code page 3 and then printing the number 6.
Is there a way to let the printer know that the 6 is part of my command?
If you know of a different workaround please comment below.
Thanks
You are making a mistake, you aren't meant to replace n with an actual number.
The proper syntax in your case would be ←t$
Explanation: the manual says "ESC t n", n referring to the page sheet, however you don't replace n with a number rather with the ASCII character n, so in your example 36 = $ because $ is the 36th character on the ASCII table.
NSEvent has a characters property which is a NSString valid for key up/down events. Under what conditions can the string length be greater than 1?
The only condition I have been able to find till now is when the NSEvent corresponds to input from an IME (Input Method Editor).
Edit - I knew about the surrogate pair case, but it somehow slipped out of my mind while asking this. I am more interested in the case when the no. of graphemes(characters) is greater than 1 itself.
Under what conditions can the string length be greater than 1?
When you have a keyboard/input method which can input any single character which requires a surrogate pair in UTF-16, e.g. a 𐀀 (Unicode Linear B Syllable B008 A), then the length will be 2. This is because length returns the number of 16-bit code units, not the number of characters.
You can also get this with programmatically-posted events. CGEventKeyboardSetUnicodeString() allows the caller to attach any arbitrary string to the key event.
High unicode codepoints are coded with a character sequence in Mac OS X. Try 𫝑.
For example:
x := #123;
I tried to search around Google but I simply have no idea what this means.
IIRC it means a character value of the number (eg. #32 -> space).
#123 is a character (Char type) of the ordinal value 123.
It's character code. #97 is equivalent to 'a' etc etc
A chart can be see here.
It is an extention to standard Pascal, Borland Pascal accepts the pound sign ('#') followed immediately by a decimal number between 0 and 255 as a single character with that code.
As other have mentioned it's a character code, I most often see them used for line breaks in messages, or other control character such as Tab (#9)
ShowMessage('Error:'#13#10'Something terrible happened')
Strangely it's not necessary to concatinate a string involving these.
It's character code. #97 is equivalent to chr(97) etc etc