Presentation is loading. Please wait.

Presentation is loading. Please wait.

WYSINWYG Keith Merrington May 2011 / Page 1 Practical Examples Keith Merrington APP02 When WYI is not WYG (When What You Input is not What You Get)

Similar presentations


Presentation on theme: "WYSINWYG Keith Merrington May 2011 / Page 1 Practical Examples Keith Merrington APP02 When WYI is not WYG (When What You Input is not What You Get)"— Presentation transcript:

1 WYSINWYG Keith Merrington May 2011 / Page 1 Practical Examples Keith Merrington APP02 When WYI is not WYG (When What You Input is not What You Get)

2 WYSINWYG Keith Merrington May 2011 / Page 2 The Problem – or what can go wrong Keyboard Scan codes Keyboard Layout PC Interpretation Code Pages Fonts Screen

3 WYSINWYG Keith Merrington May 2011 / Page 3 The Keyboard - Scan codes For every key on the keyboard a scan code is generated mostly USB keyboards use different scan codes! (mostly specified in the USB standard )

4 WYSINWYG Keith Merrington May 2011 / Page 4 Input – the keyboard The problem begins with the keyboard –There is the “standard” 83 key keyboard

5 WYSINWYG Keith Merrington May 2011 / Page 5 Input – the keyboard The problem begins with the keyboard –There is the “standard” 84 key keyboard

6 WYSINWYG Keith Merrington May 2011 / Page 6 Input – the keyboard The problem begins with the keyboard –There is the “standard” 84 key keyboard

7 WYSINWYG Keith Merrington May 2011 / Page 7 Input – the keyboard The problem begins with the keyboard –There is the “standard” 101 key keyboard

8 WYSINWYG Keith Merrington May 2011 / Page 8 Input – the keyboard The problem begins with the keyboard –There is the “standard” 102 key keyboard

9 WYSINWYG Keith Merrington May 2011 / Page 9 Input – the keyboard The problem begins with the keyboard –There is the “standard” 104 key keyboard

10 WYSINWYG Keith Merrington May 2011 / Page 10 Input – the keyboard The problem begins with the keyboard –There is the “standard” 106 key keyboard

11 WYSINWYG Keith Merrington May 2011 / Page 11 Input – the keyboard The problem begins with the keyboard –Then there is a QWERTY –Then there is a QWERTZ –Then there is a ……….. –Then there are Laptop keyboards

12 WYSINWYG Keith Merrington May 2011 / Page 12 Input – the keyboard There is even a keyboard for Blondes

13 WYSINWYG Keith Merrington May 2011 / Page 13 Input – the keyboard Complete with those extra keys

14 WYSINWYG Keith Merrington May 2011 / Page 14 Input – the keyboard Definitions:

15 WYSINWYG Keith Merrington May 2011 / Page 15 Keyboard – Special Keys To use a special key such as “Mail” etc First by using the RHMB obtain “New Function” Select then follow instructions.

16 WYSINWYG Keith Merrington May 2011 / Page 16 Keyboard – Special Keys Give a description Press special key Then make this a hot key In the program concerned

17 WYSINWYG Keith Merrington May 2011 / Page 17 Input – the keyboard US International Keyboard (Key assignment) This is not the same as a Windows Keyboard!

18 WYSINWYG Keith Merrington May 2011 / Page 18 Input – the keyboard A keyboard has –Alphanumeric keys and numeric keys (A-Z 0-9 etc) –Function Keys (F1-F12 or more) –Modifier key(i.e. ALT, SHIFT, –Compose key (Not used in OS/2) –AltGr key (used to compose special characters) –etc

19 WYSINWYG Keith Merrington May 2011 / Page 19 Input – the keyboard Using the ALT key and numeric keys on the numeric keyboard directly produce a character code. Useful for characters not directly available on a keyboard Examples: –ALT + 157 is the same as ¥ –ALT + 242 is the same as ≥ Note the results depend on the codepage

20 WYSINWYG Keith Merrington May 2011 / Page 20 Input – the keyboard Using the ALTGR (Right hand ALT key) can produce special characters depending on the keyboard that has been selected. Example (US INTERNATIONAL KB) : –ALTGR + 1 2 3 4 = ¹ ² ³ £ –ALTGR + : then a = ä

21 WYSINWYG Keith Merrington May 2011 / Page 21 Interpretation of the Keys When a key is depressed the scan code is sent to the PC. When a key is release the scan code is sent to the PC. The data sent is translated into internal code. Originally this was ASCII (American Standard Code for Information Interchange)

22 WYSINWYG Keith Merrington May 2011 / Page 22 Ascii Table The ASCII table originally only used 7 bits. In an 8 bit system the MSB (most significant bit) is always zero. The characters that could be encoded using this scheme were the standard Latin alphabet plus numbers, punctuation marks, and some symbols and is shown below.

23 WYSINWYG Keith Merrington May 2011 / Page 23 Ascii Table The ASCII table also has for the values 0 to 31 (decimal) so called “Control Codes”

24 WYSINWYG Keith Merrington May 2011 / Page 24 An ASCII Table - extended Extended ASCII was developed. Extended ASCII used the 8 bit, extending the character set with 128 characters and typographical symbols

25 WYSINWYG Keith Merrington May 2011 / Page 25 ASCII Control Codes Dos originated from CP/M and as such inherited a number of codes that are still valid today The ASCII control codes (decimal 00 to 31) are not characters! Some codes shown are clear, Escape, TAB, and Backspace, while others relate to functions originating in the pre-history of computing such as Start of Text, BELL etc

26 WYSINWYG Keith Merrington May 2011 / Page 26 Control Codes To enter a control code you use the control key. –This has the effect of zeroing the 3 most significant bits. So an A which is in hex 41 becomes 01 –Is displayed (in most cases) with a caret (^) character, in which the caret represents Ctrl. Entering Ctrl-A will be displayed as ^A.

27 WYSINWYG Keith Merrington May 2011 / Page 27 Control Codes Special codes –Ctrl-C : terminate a running program. –Ctrl-H this character has the same function as the backspace key. –Ctrl-I this character has the same function as the TAB key –Ctrl-M this character has the same function as the Enter Key. The operating system however translate this to into two actions, line feed and carriage return. –Ctrl-W this character has the same function as the Backspace key. –Ctrl-Z this character is used to indicate end of input or end of file. –Ctrl-[ this character has the same function as the Esc key. –Ctrl-L Form Feed/New Page Beware: –Ctrl-P (This only applies to DOS command prompts!) Turns on or off the printer echo function. –There is no way of checking the state of the Ctrl-P toggle. Fortunately it exists only in the DOS session in which it was set.

28 WYSINWYG Keith Merrington May 2011 / Page 28 Control Codes WYSI NOT WYG Enter the following: –Ctrl-D Ctrl-E Ctrl-F Ctrl-G > test.txt then Enter –on the screen you will see ^D^E^F^G, which you would expect to be ♦♣♠= But if you use the TYPE command to display the file just created to the screen you will see only the following: ♦♣♠

29 WYSINWYG Keith Merrington May 2011 / Page 29 Control Codes WYSI NOT WYG Some PM programs also suffer from problems with Control Codes GFC does not like → (escape code) no lines after this character will be displayed! There may be more programs that have similar problems

30 WYSINWYG Keith Merrington May 2011 / Page 30 Codepages There existed various Extended ASCII versions. By introducing “codepages” a particular character set was defined. OS/2 supports about 49 different codepages

31 WYSINWYG Keith Merrington May 2011 / Page 31 Codepages OS/2 defines the codepage in CONFIG.SYS –is CODEPAGE XXX, (YYY) where XXX is the initial codepage and YYY (which is optional) is the alternate codepage. Even codepages are subject to change as with the introduction of the Euro a new currency symbol was introduced, but since all characters were taken it replaced an existing character!

32 WYSINWYG Keith Merrington May 2011 / Page 32 Codepages The most common codepages for OS2 are: 437 - United States 850 - Latin 1 1004 - Windows Latin 1

33 WYSINWYG Keith Merrington May 2011 / Page 33 Codepages (470,850,1004) Part 1

34 WYSINWYG Keith Merrington May 2011 / Page 34 Codepages (470,850,1004) part 2

35 WYSINWYG Keith Merrington May 2011 / Page 35 Codepages (470,850,1004) part 3

36 WYSINWYG Keith Merrington May 2011 / Page 36 Changing a code page Changing a code page is possible using CHCP in a command window. –It is limited to the two pages specified in CONFIG.SYS Changing or detecting a code page of a PM program is is possible using a program such as CodePage Pal

37 WYSINWYG Keith Merrington May 2011 / Page 37 Code Pages - Solutions Code Page Pal is on Hobbes /pub/os2/util/wps/cppal030.zip Note: a PM code page change is only visible after a font change

38 WYSINWYG Keith Merrington May 2011 / Page 38 Code page problems The most common problem is when a Windows text file is read in OS/2 or eCS

39 WYSINWYG Keith Merrington May 2011 / Page 39 Code Pages - Solutions Text Converter http://www.os2world.com/goran/zip/textc092.zip

40 WYSINWYG Keith Merrington May 2011 / Page 40 Code Pages - Solutions Firefox Use View and then Character encoding

41 WYSINWYG Keith Merrington May 2011 / Page 41 Unicode By using Unicode all ambiguity with regard to character sets and codepages can be removed. Unicode has a unique code for every character Unicode is used in OS2. JFS uses Unicode for all file names internally. It needs DEVICE=X:\OS2\BOOT\UNICODE.SYS in order to covert to the current code page In PM programs codepage 1200 (Unicode is available)

42 WYSINWYG Keith Merrington May 2011 / Page 42 Unicode Use Double Byte Charater Map from Alex Taylor

43 WYSINWYG Keith Merrington May 2011 / Page 43 Fonts Not all fonts contain ALL characters and symbols

44 WYSINWYG Keith Merrington May 2011 / Page 44 Practical Examples Thank you


Download ppt "WYSINWYG Keith Merrington May 2011 / Page 1 Practical Examples Keith Merrington APP02 When WYI is not WYG (When What You Input is not What You Get)"

Similar presentations


Ads by Google