24
Unicode and Keyboards on Windows Michael Kaplan Cathy Wissink Globalization Infrastructure and Font Technology Windows International Microsoft

Unicode and Keyboards on Windows

Embed Size (px)

Citation preview

Page 1: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 1/24

Unicode and Keyboards on

Windows

Michael KaplanCathy Wissink

Globalization Infrastructure and Font Technology

Windows International

Microsoft

Page 2: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 2/24

25 March 2003 Prague, Czech Republic (IUC23) 2

Who is this talk geared towards? 

This is a high-level introduction tokeyboards on Windows, assuming no priorknowledge.

Audience: – Developers new to concept – People who need to understand keyboards

enough to understand how applications canwork with them – Not completely intended to be a “nuts and

bolts” talk 

Page 3: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 3/24

25 March 2003 Prague, Czech Republic (IUC23) 3

Keyboards are simple, right?

Fonts

Rendering engines

135 different locales on WindowsCustom keyboard layouts

Turns out they are not so simple!

Page 4: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 4/24

25 March 2003 Prague, Czech Republic (IUC23) 4

Keyboard Layout, defined

A collection of data for each keystroke andshift state combination with a particularkeyboard driver (DLL)

In other words, it is not the keyboardhardware but the software that connectsthe hardware to the system

Page 5: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 5/24

25 March 2003 Prague, Czech Republic (IUC23) 5

Anatomy of a keystroke

User presses a key

Key contains a scan code

Keyboard layout DLL maps the scan codeto a virtual key (VK)

OS sends the VK to the application

If asked, the DLL maps the VK/shift stateto characters (if they are assigned)

Page 6: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 6/24

25 March 2003 Prague, Czech Republic (IUC23) 6

Page 7: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 7/24

25 March 2003 Prague, Czech Republic (IUC23) 7

Language features

single character keystrokes

ligatures

dead keysshift states

SGCap

Caps lock key

Page 8: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 8/24

25 March 2003 Prague, Czech Republic (IUC23) 8

Ligatures

For keyboard layouts, not the same as thetypographic/linguistic term

A combination of 2 to 4 UTF-16 code points

inserted by a single keystroke

Page 9: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 9/24

25 March 2003 Prague, Czech Republic (IUC23) 9

Examples of ligatures on keyboard

Tamil keyboard in the shifted state, showing linguistic charactersSri, Ksa, and others as ligatures

Page 10: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 10/24

25 March 2003 Prague, Czech Republic (IUC23) 10

Dead keys

A combination of two keystrokes to inserta single character

Used often in European languages fordiacritics

Called “dead” since the first keystroke

does not appear to do anything

Not intuitive to people who are not used tothem

Page 11: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 11/24

25 March 2003 Prague, Czech Republic (IUC23) 11

Dead key example:Diaeresis on the Finnish keyboard

Input keys 

Type ¨ (deadkey)

Type ¨ + aType ¨ + AType ¨ + o

Type¨

+ O...Type ¨ + <space>

Result 

Nothing

äÄö

Ö...¨ (spacing diaeresis)

Page 12: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 12/24

25 March 2003 Prague, Czech Republic (IUC23) 12

Shift states

Only 47-48 physical keys to work with onthe keyboard

Shift states expand that number by manytimes

For languages with casing, usually theyare cased variants of each other

More shift states available (AltGr, Ctrl)

Page 13: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 13/24

25 March 2003 Prague, Czech Republic (IUC23) 13

The Greek Keyboard, shifted and unshifted

Page 14: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 14/24

25 March 2003 Prague, Czech Republic (IUC23) 14

Caps lock

Usually intended to be a persistent Shiftkeypress (in other words, it acts like atypewriter caps lock)

Generally used to get at shift state withouthaving to press two keys concurrently

Often used with cased languages

May do nothing in languages without case,or be used for other purposes

Page 15: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 15/24

25 March 2003 Prague, Czech Republic (IUC23) 15

SGCap

Advanced usage of the Caps Lock key

Used by Swiss German, Czech, andHebrew keyboards

Adds two additional shift states

Only intuitive to people who understand

the mechanism

Page 16: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 16/24

25 March 2003 Prague, Czech Republic (IUC23) 16

APIs

keybd_eventMapVirtualKey[Ex]OemKeyScanSendInputToAscii[Ex]ToUnicode[Ex]VkKeyScan[Ex]

The APIs allow developers to do the same mappings the OSdoes when moving between scan codes, VKs, andcharacters.

Page 17: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 17/24

25 March 2003 Prague, Czech Republic (IUC23) 17

Factors in keyboard layout creation

National/regional standard?What languages need to be supported?Is the set of characters needed for thelanguage complete?Focus on code points and not glyphs?Do all required characters exist in

Unicode?Consistent use of features such as deadkeys, ligatures, etc.?

Page 18: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 18/24

25 March 2003 Prague, Czech Republic (IUC23) 18

Where do IMEs fit in?

For most languages, they don’t! 

For CJK languages, even 47 keys X 8 shiftstates is not enough

Different mechanisms and APIs are usedfor IME interaction

More information can be found in thePlatform SDK(http://msdn.microsoft.com/platformsdk)

Page 19: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 19/24

25 March 2003 Prague, Czech Republic (IUC23) 19

FAQs about keyboards

Does Microsoft make these layouts up?

How do I add every glyph for mylanguage?

Don’t I need an IME? 

How do I replace the layout for my

language if I do not like the one provided?How do I add my own keyboard layout?

Page 20: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 20/24

25 March 2003 Prague, Czech Republic (IUC23) 20

MSKLCMicrosoft Keyboard Layout Creator

Create new keyboard layouts: – Brand new layouts

 – Modified from existing keyboards

Deploy the created keyboard layout toNT4, Win2000, WinXP, or Win Server2003 machines

Save the definition of the keyboard forlater development

Page 21: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 21/24

25 March 2003 Prague, Czech Republic (IUC23) 21

MSKLC demos

Page 22: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 22/24

25 March 2003 Prague, Czech Republic (IUC23) 22

Other References

This tutorial's corresponding paperWindows Keyboard Layoutshttp://www.microsoft.com/globaldev/reference/keyboards.aspx 

Nadine Kano, Developing International Software(out of print, but still available on the web)http://microsoft.com/globaldev/dis_v1/disv1.asp

New! Developing International Software , 2ndeditionhttp://microsoft.com/globaldev/dis_v2/disv2.asp

Internationalization with Visual Basichttp://i18nWithVB.com/ 

Get on the MSKLC Beta! 

Page 23: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 23/24

25 March 2003 Prague, Czech Republic (IUC23) 23

Questions?

Page 24: Unicode and Keyboards on Windows

8/2/2019 Unicode and Keyboards on Windows

http://slidepdf.com/reader/full/unicode-and-keyboards-on-windows 24/24

25 March 2003 Prague, Czech Republic (IUC23) 24

Don't forget to fill out yourevaluations!

Unicode and Keyboardson Windows