Top Navigational Bar

Macro Command - {SYSTEM}Keystate~
DocumentID: 651374
Revision Date: 29-Feb-96 8:29:06 PM

The information in this document applies to:
WordPerfect® 5.1 for DOS

Problem

Symptoms: When the customer uses {SYSTEM}26~ (or {SYSTEM}keystate~) in a macro, the results are inconsistent. On an IBM PSII model 80, (using PC DOS 4.01) the values for right shift and left shift are the same as we state in our readme file. But on the AST Premium all the values are wrong. For example right shift is 512+1, or 513, and left shift is 512+2, or 514. The value is 512 more than it should be . Why is this? Solutions: The values returned for {SYSTEM}keystate~ are precisely what the BIOS provides to us. According to the IBM BIOS Interface Technical Reference Manual, the first 8 bits returned (which correspond to values from 0 to 255) are defined precisely as we have documented them (1=right shift, 2=left shift, 4=ctrl, 8=Alt, 16=Scroll lock, 32=Num lock, 64=caps lock, 128=insert).

The next 8 bits are documented as "reserved." This means that those bits may be set to any value, depending on how IBM (and other BIOS manufacturers) chooses to define them in the future. It would be ludicrous for WordPerfect to force those upper bits to be 0, since that would prevent users from taking advantage of enhancements to their BIOS which we cannot at this time predict.

In any case, the only reasonable way to deal with values returned by {SYSTEM}keystate~ is to look at individual bits by using a mask (e.g., {SYSTEM}keystate~&8 to isolate the state of the Alt key), and so it should be entirely irrelevant what the values of undocumented bits are.

Answer:

Details:


Product specifications, packaging, technical support and information (*Specifications*) refer to theUnited States retail English version only. Specifications for other versions may vary. All Specifications, claims, features, representations, and/or comparisons provided are correct to the best of our knowledge of the date of publication, but are subject to change without notice.OUR MAXIMUM AGGREGATE LIABILITY TO YOU AND THAT OF OUR DEALERS AND SUPPLIERS IS LIMITED. IT SHALL NOTEXCEED THE AMOUNT YOU PAID TO ACCESS THE INFORMATION. SEE LEGAL DISCLAIMER.