[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: 'adding tilde to kbd file '



Reply to note from Arthur Steinberg  Thu, 03 Jun
1999 12:24:08 EDT

-> i was interested in getting option 2 below to work ( a
-> freestanding printable tilde), but find that [255] stands for
-> em space -- so i merely get a space in my keyoboard file, and
-> what does the rest of the code indicate (7,E)? am i missing
-> something here?

Well, yes. [255] may look like a space; in actuality, it's a
3-byte version of Ascii-255, which XyWrite uses as a control
character. When you assign a 3-byte 255 to a key, the key produces
a *1-byte* 255 (the 1-byte form is the control char) which
immediately combines with the next *2* chars to form a single
entity, 3 bytes long. These 3-byters vary widely in the way they
look on screen (or paper), and in what they do. One group comprises
the 380 functions (BC , GT , etc., etc.) that are the basic building
blocks of XPL. Another group are the reverse-video SEarch
wildcards. Yet another -- the one relevant to your problem -- is a
3-byte version of the extended Ascii character set (0-255), used to
display and print characters (like your tilde) that, in 1-byte form,
don't display as such but perform a task (like causing words to
hyphenate). Each char in the 3-byte charset consists of Ascii-255
plus two additional bytes corresponding to the hexadecimal character
number. Thus, a 3-byte Ascii-0 consists of [255]+"00", a 3-byte
left guillemet (Ascii-174) consists of [255]+"AE" (AE hex = 174
decimal), a 3-byte right guillemet (Ascii-175) is [255]+"AF", and so
on. Now, the tilde is Ascii-126, or hexadecimal 7E; therefore, the
3-byte (printable) tilde consists of [255]+"7E".

In the .KBD file specimen, 41=NO,[255],7,E, the 1-byte [255]
produced by the keypress combines with the next two chars "7E" to
form the printable tilde. (The initial func NO is required because
every compound key assignment must begin with a function; where the
task at hand doesn't require a function, you use the dummy NO, for
"No Operation".)

-> according to my chart of xy characters 757 stands for tilde
-> upper, and 758 for tilde lower. are they the ones i am supposed
-> to be using?

You *could* use 757, but it has disadvantages. The Standard
monospaced font doesn't support it, for one. Plus, in draft view,
it displays as a boldface [757], whereas a 3-byte 126 displays as a
tilde. (On the other hand, it's possible that, with some fonts, 757
may look better, or at least different, on paper. Experiment!)

-> i have tried to remove all evidence of fooling with the
-> shift+41 key since i couldn't get the tilde to work.

Don't throw in the towel! It DOES work. You're probably omitting
the initial func NO. Or you're not producing [255] correctly: Hold
down Ctrl-Alt-Shift; press 2-5-5; release the keys. The resulting
character usually looks like a space, but ... this is where I came
in.

-> now when i try to load the xy4-3.kbd file i get the following
-> message:
->
-> customization file contains an unrecognized command. ~~~41=

I'm confident that you will get the tilde to work. But, for future
reference: to disable a key, assign it a 3-byte Ascii-0: nn=[0],
where "[0]" is the char produced by holding down Ctrl-Alt-Shift,
pressing 0, then releasing the keys.

--------------
Carl Distefano
CLDistefano@xxxxxxxx