linux: Do not fallback to the hardware keycodes for modifiers.
linux: Do not fallback to the hardware keycodes for modifiers.

Previously Chrome would fall-back to deriving VKEY values directly from the hardware keycode if it was unable to derive a value from the X KeySym. While that is necessary for e.g. providing valid VKEYs for printable character keys under non-Latin keyboard layouts (such as Hebrew or Arabic), it had the side-effect of causing KeySyms with no VKEY equivalent to be mapped to incorrect meanings.

In issue 402320, for example, the ISO_Level3_Latch KeySym has no VKEY equivalent, so should result in VKEY_UNKNOWN, but was instead having an incorrect VKEY derived from the X11 keycode instead.

Note that there is no clear reason why we don't allow the modifier keys to fall back to the hardware keycode while we allow the printable character keys to fall back.  It's just close to what users expect.  There could be a problem if a keyboard layout had a composition character on Control + Ч (which falls back to VKEY_X).  Users cannot type that composition character because a Cut accelerator triggers instead.

This approach is a heuristic designed to approximate the VKEY values that a Windows system would generate, to ensure compatibility.

BUG=402320
TEST=Done manually (assigning ISO_Level3_Latch to key code 108).

Review URL: https://codereview.chromium.org/611993002

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#298478}

krieger-od/nwjs_chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,Jonekee/chromium.src,dednal/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,dednal/chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,ltilve/chromium,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,dednal/chromium.src,Chilledheart/chromium,markYoungH/chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,Jonekee/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,ltilve/chromium,markYoungH/chromium.src,dednal/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ltilve/chromium,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,jaruba/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,dushu1203/chromium.src,fujunwei/chromium-crosswalk,Chilledheart/chromium,ltilve/chromium,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,jaruba/chromium.src,Chilledheart/chromium,ltilve/chromium,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,fujunwei/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,dednal/chromium.src,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,Chilledheart/chromium,ltilve/chromium,chuan9/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk