+ All Categories
Home > Documents > How to Handle International Keyboards for Virtual Desktops ... · How to Handle International...

How to Handle International Keyboards for Virtual Desktops ... · How to Handle International...

Date post: 25-Sep-2019
Category:
Upload: others
View: 39 times
Download: 0 times
Share this document with a friend
44
How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo([email protected]), Qiang Wan([email protected]) VMware, Product Globalization
Transcript
Page 1: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

How to Handle International Keyboards for Virtual Desktops in Cloud

Zhenjun Zhuo([email protected]), Qiang Wan([email protected])

VMware, Product Globalization

Page 2: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

2

Introduction

Windows Client Mac Client

Web Client

iOS Client and Android Client

International Keyboard Testing

Agent

Page 3: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Virtual Desktops in Cloud

Desktop VMs

3

Page 4: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

International Keyboards

4

Page 5: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

International Keyboard Issues

Windows 17%

Linux 5%

Mac 20%

iOS 21%

Android 13%

ChromeOS 8%

Web 16%

INTERNATIONAL KEYBOARD ISSUES ACROSS DESKTOPS/DEVICES

German 20%

French 20%

Japanese 18%

Simplified Chinese

8%

Traditional Chinese

8%

Korean 8%

Spanish 5%

Portuguese 2%

General 6%

Others 5%

INTERNATIONAL KEYBOARD ISSUES ACROSS LANGUAGES

• Above international keyboard issues are filtered from VMware bug tracking system as of July 2016 • General: general international keyboard issues are applying to all languages • Others: others includes 15 other input languages 5

Page 6: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Keyboard Handling Architecture Agent

Client

Keyboard

SendInput

Network

Keyboard Event Filtering

Keyboard Input Steam

Key Packets

Key Packets

6

Page 7: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

7

Introduction

Windows Client Mac Client

Web Client

iOS Client and Android Client

International Keyboard Testing

Agent

Page 8: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Windows Keyboard Input

8

* https://msdn.microsoft.com/en-us/library/windows/desktop/ms646267(v=vs.85).aspx

Page 9: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Simulating Input: SendInput

UINT WINAPI SendInput( _In_ UINT nInputs, _In_ LPINPUT pInputs, _In_ int cbSize );

Scan code

Unicode

SendInput OR Keyboard Packets

9

* https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx

Page 10: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Language Synchronization: InstallLayoutOrTip

BOOL InstallLayoutOrTip( _In_ LPCWSTR psz, _In_ DWORD dwFlags, );

Layout Id

Lang Id

Keyboard State

Packet AND InstallLayoutO

rTip

Layout Id Lang Id

“0409” (United States) “040C” (French)

10

Presenter
Presentation Notes
https://msdn.microsoft.com/en-us/library/windows/desktop/bb847909(v=vs.85).aspx
Page 11: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Remapping Keys - From US 101 to JA 106

US 101 JA 106

@ "

^ &

* (

( )

] [

\ ]

Some mismatches:

11

Page 12: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Remapping Keys - From US 101 to JA 106

• Add 20 key remaps in registry: ID US 101 JA 106

0 tilde Shift + @

1 Shift + tilde Shift + ^

2 Shift + 2 @

3 Shift + 6 ^

4 Shift + 7 Shift + 6

5 Shift + 8 Shift + :

6 Shift + 9 Shift + 8

7 Shift + 0 Shift + 9

8 Shift + - Shift + \

9 = Shift + -

ID US 101 JA 106

10 Shift + = Shift + ;

11 [ [

12 Shift + [ Shift + [

13 ] ]

14 Shift + ] Shift + ]

15 Shift + ; :

16 ' Shift + 7

17 Shift + ' Shift + 2

18 \ Yen/Vertical bar

19 Shift + \ Shift + Yen/Vertical bar 12

Presenter
Presentation Notes
VMware KB: 2110744
Page 13: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

13

Introduction

Windows Client Mac Client

Web Client

iOS Client and Android Client

International Keyboard Testing

Agent

Page 14: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Windows Client: General Process /* WM_KEYDOWN, WM_KEYUP */ bool type = get_event_type(e); /* Windows Scan Code */ uint scancode = get_scancode(e); /* Filtering and special handling */ if(is_special(scancode, type) { /* do something for special events*/ } /* Generate and send keyboard package */ if(scancode) { r = send_keyboard_event(scancode, type); }

Following Slides: 1. Handling special events 2. Language synchronization

14

Presenter
Presentation Notes
Page 15: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Handling Special Events: Issue

* Cannot catch KEYDOWN messages for VSCAN_HANGUL_EN and VSCAN_HANJA_EN

15

Presenter
Presentation Notes
Page 16: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Handling Special Events: Solution

Bool sendExtraDownToGuest = FALSE; if (up) { if (vscancode == VSCAN_HANGUL_EN || vscancode == VSCAN_HANJA_EN) { sendExtraDownToGuest = TRUE; } }

16

Presenter
Presentation Notes
� �
Page 17: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Language Synchronization: Client Process

EnumEnabledLayoutOrTip

• langId • layoutId

• langId • layoutId

• langId • layoutId

Send to Agent

* Windows API

17

* https://msdn.microsoft.com/en-us/library/windows/desktop/bb847907(v=vs.85).aspx

Presenter
Presentation Notes
https://msdn.microsoft.com/en-us/library/windows/desktop/bb847907(v=vs.85).aspx
Page 18: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

18

Introduction

Windows Client Mac Client

Web Client

iOS Client and Android Client

International Keyboard Testing

Agent

Page 19: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Mac Client: General Process /* NSKeyDown, NSKeyUp, NSFlagsChanged */ bool type = get_event_type(e); /* Mac ADB(Apple Desktop Bus) code */ uint adb_code = get_ADBCode(e); /* Translate Mac ADB code to scan code*/ scancode = Mapping_ADBtoScan(adb_code); /* Generate and send keyboard package */ if(scancode) { r = send_keyboard_event(scancode, type); }

19

Presenter
Presentation Notes
Page 20: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Map Mac-specific keys

20

Presenter
Presentation Notes
Page 21: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

21

Introduction

Windows Client Mac Client

Web Client

iOS Client and Android Client

International Keyboard Testing

Agent

Page 22: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Web Client: General Process /* keydown, keyup, keypress */ bool type = get_event_type(e); /* keyCode is used to represent a unique key * Need to handle browser difference here */ var keyCode = get_keyCode(e); /* Translate keyCode to scan code or Unicode*/ var result = Mapping_KeytoSU(keyCode); /* Generate and send keyboard package */ if(result.value) { r = send_keyboard_event(result.value, result.isunicode, type); }

Following Slides: 1. Get keyCode from different browsers 2. Example of special events

22

Presenter
Presentation Notes
Page 23: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Keyboard Event Properties

* https://dvcs.w3.org/hg/d4e/raw-file/tip/key-event-test.html

23

Presenter
Presentation Notes
Page 24: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Browser Difference: “a” of EN

Keydown Keyup Keypress

keyCode which keyIdentifier keyCode which keyIdentifier keyCode which keyIdentifier

Edge/20 65 65 65 65 97 97

Firefox/47.0 65 65 65 65 0 97

Chrome/51 65 65 U+0041 65 65 U+0041 97 97 U+0041

Safari/9.1.1 65 65 U+0041 65 65 U+0041 97 97

24

Presenter
Presentation Notes
Page 25: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Browser Difference: Get keyCode var keyCode = 0, isUnicode = false, property = ‘keyCode’; if (e.keyCode) { keyCode = e.keyCode; } else if (e.which) { keyCode = e.which; property = ‘which’ ; } else if (e.keyIdentifier) { keyCode = e.keyIdentifier; property = ‘keyIdentifier’; isUnicode = true; } else { /* Special events handling */ }

25

Presenter
Presentation Notes
Page 26: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Browser Difference: German Characters Demo

26

Presenter
Presentation Notes
Page 27: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Browser Difference: Issue(“ü” of DE)

Keydown Keyup Keypress

keyCode which keyIdentifier keyCode which keyIdentifier keyCode which keyIdentifier

Edge/20 186 186 186 186 252 252

Firefox/47.0 0 0 0 0 0 252

Chrome/51 186 186 U+00BA 186 186 U+00BA 252 252 U+00FC

Safari/9.1.1 219 219 U+00FC 219 219 U+00FC 252 252

27

Presenter
Presentation Notes
Page 28: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Browser Difference: Solution

if (this.keyboardLayoutId == "de-DE" &&e.keyCode == 0 && WMKS.BROWSER.isFirefox()){ keyCode = Mapping_keytokeyCode(e.key); }

• Check other properties and map to keyCode, for example: ‘key’

e.key keyCode

ü/Ü 252

ö/Ö 246

ä/Ä 228

• Mapping table for German characters:

28

Presenter
Presentation Notes
Page 29: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

29

Introduction

Windows Client Mac Client

Web Client

iOS Client and Android Client

International Keyboard Testing

Agent

Page 30: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

iOS Client and Android Client

30

Page 31: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Onscreen vs. Physical Keyboards

• No modifier keys and functional keys

31

Page 32: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Onscreen vs. Physical Keyboards

• Long tap and popup alternate keys

32

Page 33: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Onscreen vs. Physical Keyboards

• Emoji characters

33

Page 34: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Onscreen vs. Physical Keyboards

• 10-key input for CJK phones

34

Page 35: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Keyboard Controller Workflow

35

Direct Input Mode

Local Input Mode

Accessory Keys

Btn onClick Send Scan

code

Key-Scancode Mapping

Send Unicode

Send Scan code

On Enter or Tap

Send Btn

On Text Change

Send Unicode

Yes No

Page 36: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Use Case 1: Typing Korean Characters • Typical blocks for Korean characters

• For example • Typing “한글” (Hangul)

• ㅎㅏㄴ(한)ㄱㅡㄹ(글) • Typing “가” (ga)

• ㄱㅏ(가) • Typing backspaces for “간” (gan)

• History issues • Jamos typed failed to form a Korean character • Typing backspace key, the last Korean character failed to decompose into jamos

I M I M

I M

M I M

F * From wikipedia

간 가 ㄱ

36

Presenter
Presentation Notes
https://en.wikipedia.org/wiki/Hangul
Page 37: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Use Case 1: Typing Korean

37

Page 38: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Use Case 2: Typing French

38

Page 39: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

39

Introduction

Windows Client Mac Client

Web Client

iOS Client and Android Client

International Keyboard Testing

Agent

Page 40: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

International Keyboard Testing Matrix

For Platform P = Language L = , and browser B=

Matrix M = P * L + P*L* B

Windows Linux Mac iOS Android Chrome OS

German

French

Japanese

Simplified Chinese

Traditional Chinese

Korean

IE - - - - -

Chrome Chrome Chrome - Chrome

Chrome

Firefox Firefox Firefox - - -

- - Safari Safari

- -

40

Page 41: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

International Keyboard Test Cases

41

Automate repetitive tasks that testers slowly become less focused

2915 Overall international keyboard test cases

2889 Automated

99% Automation rate

Page 42: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Automation for Intl Keyboard E2E Testing

Tools Sample Function

Windows C# keybd_event

Mac Apple Script tell application "System Events" to key code {1}

Linux Python Virtkey

iOS Instruments UIAButton tap

Android UI Automator device.click(int x, int y)

42

Page 43: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Takeaways

• International keyboard handling process • Use cases and demos • International keyboard testing

43

Presenter
Presentation Notes
Page 44: How to Handle International Keyboards for Virtual Desktops ... · How to Handle International Keyboards for Virtual Desktops in Cloud Zhenjun Zhuo (zzhuo@vmware.com), Qiang Wan(qwan@vmware.com)

Questions & Answers

44


Recommended