summaryrefslogtreecommitdiffstats
path: root/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
Commit message (Collapse)AuthorAgeFilesLines
* Move base::FreeDeleter into its own header.dcheng2016-03-261-0/+1
| | | | | | | | | | Final blocker to wholly deleting base/memory/scoped_ptr.h. BUG=554298 Review URL: https://codereview.chromium.org/1837483003 Cr-Commit-Position: refs/heads/master@{#383417}
* Generate located Windows keycodes for number pad keys under Ozonekpschoedel2016-03-171-5/+10
| | | | | | | | | | | | Makes Ozone's XKB keyboard layout support generate Windows keycodes VKEY_NUMPAD0 through VKEY_NUMPAD9 for number pad keys, rather than VKEY_0 through VKEY_9, to match the X11 behaviour. BUG=574458 Review URL: https://codereview.chromium.org/1566463002 Cr-Commit-Position: refs/heads/master@{#381709}
* xkb: Restore layout init for non CHROMEOS buildsjbriance2016-03-031-2/+9
| | | | | | | | | | Restore keyboard layout initialization part that has been removed in https://crrev.com/728aa809ad for non CHROMEOS builds. This part was first introduced in https://crrev.com/c288ff74 Review URL: https://codereview.chromium.org/1751403005 Cr-Commit-Position: refs/heads/master@{#379017}
* Allow std::unordered_*.davidben2016-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of https://codereview.chromium.org/1502373009 with some fixes for components/metrics/leak_detector allocator type mismatches. Original issue's description: > Allow std::unordered_*. > > base::hash_* is, as a transition step, implemented in terms of > std::unordered_*. Later commits will convert existing uses. > > Also fix a host of IWYU problems that arose from this CL. > > (NOPRESUBMIT because the wstring presubmit check is overzealous > and complains about the reference to wstring in the comment.) > > Committed: https://crrev.com/3f37f7f1459e7b5a452c0e433493e0a6e9649ca7 > Cr-Commit-Position: refs/heads/master@{#370553} BUG=576864 TBR=derat@chromium.org,danakj@chromium.org,dalecurtis@chromium.org,jbauman@chromium.org,blundell@chromium.org NOPRESUBMIT=true CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1615713003 Cr-Commit-Position: refs/heads/master@{#370867}
* Revert of Allow std::unordered_*. (patchset #15 id:280001 of ↵davidben2016-01-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1502373009/ ) Reason for revert: MSan build failure. https://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20Linux%20ChromeOS%20MSan%20Builder/builds/12498 Original issue's description: > Allow std::unordered_*. > > base::hash_* is, as a transition step, implemented in terms of > std::unordered_*. Later commits will convert existing uses. > > Also fix a host of IWYU problems that arose from this CL. > > (NOPRESUBMIT because the wstring presubmit check is overzealous > and complains about the reference to wstring in the comment.) > > NOPRESUBMIT=true > BUG=576864 > TBR=derat@chromium.org,blundell@chromium.org,jbauman@chromium.org,dalecurtis@chromium.org > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/3f37f7f1459e7b5a452c0e433493e0a6e9649ca7 > Cr-Commit-Position: refs/heads/master@{#370553} TBR=danakj@chromium.org,thakis@chromium.org,derat@chromium.org,blundell@chromium.org,dalecurtis@chromium.org,jbauman@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=576864 Review URL: https://codereview.chromium.org/1610023003 Cr-Commit-Position: refs/heads/master@{#370559}
* Allow std::unordered_*.davidben2016-01-211-0/+2
| | | | | | | | | | | | | | | | | | | base::hash_* is, as a transition step, implemented in terms of std::unordered_*. Later commits will convert existing uses. Also fix a host of IWYU problems that arose from this CL. (NOPRESUBMIT because the wstring presubmit check is overzealous and complains about the reference to wstring in the comment.) NOPRESUBMIT=true BUG=576864 TBR=derat@chromium.org,blundell@chromium.org,jbauman@chromium.org,dalecurtis@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1502373009 Cr-Commit-Position: refs/heads/master@{#370553}
* Clean up event flags a bit:pkasting2016-01-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Reorder to group related items together. Add group comments. * Rename {NUM,CAPS,SCROLL}_LOCK_DOWN to ..._ON, in hopes of avoiding confusion as to whether the event is about one of these keys actually being pressed down versus just conveying the current state of the various locks. * Rename EF_EXTENDED to EF_IS_EXTENDED_KEY in hopes of greater clarity. Move it to the KeyEvent-specific enum since it's non-sensical for non-KeyEvents. * Expose MouseEvent::button_flags() since a couple callers outside the class wanted it. * Move Event::IsRepeat() to KeyEvent (to match the enum placement) and rename it unix_hacker()-style. (There are a ton of other functions in event.h that should be named that way, but there's only so much drudgery I can stand.) * Add some missing bits: missing static_asserts in the Mojo code that didn't check all enum values were equal, a missing SCROLL_LOCK_ON check in the exo code that would have no functional effect but looked unduly suspicious. * Attempt to reorder code to either check/use these enum values in the same order they're declared, or, in cases like code mapping GTK enum values to these values, in the order of the GTK enum values (and similar). BUG=none TEST=none Review URL: https://codereview.chromium.org/1559163002 Cr-Commit-Position: refs/heads/master@{#368456}
* Fix Windows-compatible keycode for Swedish "+" key.kpschoedel2016-01-081-1/+0
| | | | | | | | | | | | | Removes the mapping from +?\ to VKEY_OEM_MINUS so that the default VKEY_OEM_PLUS applies; this makes the Control+ shortcut (zoom in) work. BUG=chrome-os-partner:47992 R=spang@chromium.org Review URL: https://codereview.chromium.org/1570673002 Cr-Commit-Position: refs/heads/master@{#368236}
* Rename KEY_ constants to avoid conflict with <linux/input.h>kpschoedel2016-01-071-20/+20
| | | | | | | | | | | | | | | | | | | Most |enum class DomCode| constants are named by mapping the names from the W3C specification from CamelCase to SHOUTY_CASE. For the Latin letters, named 'KeyX' in the spec, the KEY_X form conflicts with macro definitions in <linux/input.h>. This change renames DomCode::KEY_X constants to DomCode::US_X to avoid the conflict and to highlight that these are positional codes corresponding to the labels on a US QWERTY layout. (TBR for 15 files with only spelling changes.) R=wez@chromium.org TBR=ben@chromium.org Review URL: https://codereview.chromium.org/1560293002 Cr-Commit-Position: refs/heads/master@{#368075}
* Switch to standard integer types in ui/events/.avi2015-12-241-0/+3
| | | | | | | | | BUG=138542 TBR=sky@chromium.org Review URL: https://codereview.chromium.org/1549553004 Cr-Commit-Position: refs/heads/master@{#366797}
* Set KeyEvent::key_ per spec for control characters under Ozonekpschoedel2015-10-201-29/+60
| | | | | | | | | | | | | | | The UI Events key event standard, which ui::KeyEvent follows for the |key_| field, specifies that when the Control key is down the value is that of the corresponding non-Control character. This change modifies KeyEvent, the platform-independent conversions, and the Ozone keyboard layout. Other platforms require additional platform-specific work. BUG=527111 Review URL: https://codereview.chromium.org/1409823002 Cr-Commit-Position: refs/heads/master@{#355130}
* Remove ui::KeyEvent::platform_keycode_kpschoedel2015-09-161-3/+1
| | | | | | | | | | | | This field had been added as a temporary measure to support X11 Keysym-based character composition under Ozone. Since crrev.com/ed31ed it is no longer necessary. BUG=442757 Review URL: https://codereview.chromium.org/1312833006 Cr-Commit-Position: refs/heads/master@{#349195}
* Revise ui::DomKey to unify character and non-character codes.kpschoedel2015-08-281-23/+16
| | | | | | | | | | | | | | | | | | | | | | | DomKey becomes a single integer value corresponding to the DOM UI Events KeyboardEvent.key string; it can represent either a Unicode code point or one of the defined non-printable values from <https://w3c.github.io/DOM-Level-3-Events-key/>. In the previous representation, ui::DomKey enumerated only the non- printable values and had a sentinel to indicated that a character value was held separately. Much of this CL therefore merely replaces |key, character| pairs with a single |key| value. The most substantial changes are to ui/events/keycodes/dom/dom_key.h ui/events/keycodes/dom/keycode_converter.h ui/events/event.h and associated implementations. BUG=227231 Review URL: https://codereview.chromium.org/1284433002 Cr-Commit-Position: refs/heads/master@{#346152}
* Finish refactoring of DomCodeToUsLayoutKeyboardCode().kpschoedel2015-07-201-16/+10
| | | | | | | | | | | A previous inadvertently left two private copies of this in different places with slightly different behaviour. BUG=chrome-os-partner:42619 Review URL: https://codereview.chromium.org/1233663006 Cr-Commit-Position: refs/heads/master@{#339447}
* ozone: evdev: Use in-class member initializers for built-in typesspang2015-06-161-3/+1
| | | | | | | | | | | | When initializing builtin-typed members to a constant, use the C++11 in-class initializers. BUG=none TEST=compile Review URL: https://codereview.chromium.org/1178683013 Cr-Commit-Position: refs/heads/master@{#334724}
* Rename ui/events/keycodes/dom[34]/ into .../dom/kpschoedel2015-05-111-3/+3
| | | | | | | | | | | | The names dom3 and dom4 reflect obsolete documentation and no longer denote anything useful. R=wez TBR=jam Review URL: https://codereview.chromium.org/1136503003 Cr-Commit-Position: refs/heads/master@{#329176}
* Set ui::KeyEvent::key_ (DOM Level 3 key) under X11.kpschoedel2015-05-081-19/+3
| | | | | | | | | | Shares more code between uses of X11 xkb and (Ozone) libxkbcommon. BUG=444048 Review URL: https://codereview.chromium.org/1103263004 Cr-Commit-Position: refs/heads/master@{#328967}
* Revise Control+key restriction for XKB layouts.kpschoedel2015-04-271-6/+4
| | | | | | | | | R=spang BUG=444048 Review URL: https://codereview.chromium.org/1110693002 Cr-Commit-Position: refs/heads/master@{#327099}
* Revert of Take GetCharacterFromKeyCode() out behind the barn. (patchset #4 ↵kpschoedel2015-04-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:60001 of https://codereview.chromium.org/1072193004/) Reason for revert: MenuControllerMnemonicTestMnemonicMatch.MnemonicMatch failure in http://master.chrome.corp.google.com:8011/builders/cros%20trunk/builds/32987 https://code.google.com/p/chromium/issues/detail?id=480638 BUG=480638,444048 Original issue's description: > Remove GetCharacterFromKeyCode(). > > Remaining uses of GetCharacterFromKeyCode() are replaced with > DomCodeToUsLayoutMeaning() to make explicit that the mapping uses a > fixed US English layout and not the user's current layout, and to use > ui::DomCode in preference to the legacy Windows-based ui::KeyboardCode. > > BUG=444048 > > Committed: https://crrev.com/121b8680676123f617ebc69770cbb114c030fbd3 > Cr-Commit-Position: refs/heads/master@{#326553} TBR=sadrul@chromium.org,wez@chromium.org,jam@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=444048 Review URL: https://codereview.chromium.org/1085733007 Cr-Commit-Position: refs/heads/master@{#326799}
* Fix VKEY determination for non-US layouts under Ozone.kpschoedel2015-04-231-49/+37
| | | | | | | | | | | | | | | | | | We attempt to match Windows behaviour for the value of VKEY on a keystroke. Some XKB layouts generate characters for AltGr+key combinations that are not present in the reference (Windows-based) sources, which led to mismtaches in the mappings, and incorrect VKEY values for those keys. To avoid this, we match on any AltGr+key result in cases the reference has none. The corresponding test is revised to use a valid dummy character for those cases, rather than 'NoSymbol'. BUG=480529 Review URL: https://codereview.chromium.org/1100393005 Cr-Commit-Position: refs/heads/master@{#326695}
* Remove GetCharacterFromKeyCode().kpschoedel2015-04-231-6/+4
| | | | | | | | | | | | | Remaining uses of GetCharacterFromKeyCode() are replaced with DomCodeToUsLayoutMeaning() to make explicit that the mapping uses a fixed US English layout and not the user's current layout, and to use ui::DomCode in preference to the legacy Windows-based ui::KeyboardCode. BUG=444048 Review URL: https://codereview.chromium.org/1072193004 Cr-Commit-Position: refs/heads/master@{#326553}
* Use DOM- rather than Windows-based key code for non-layout cases.kpschoedel2015-04-211-5/+16
| | | | | | | | BUG=444048 Review URL: https://codereview.chromium.org/841263005 Cr-Commit-Position: refs/heads/master@{#326111}
* Don't do XKB lookup for DomCode::NONE.kpschoedel2015-02-231-0/+2
| | | | | | | | | | This avoids a spurious log error. BUG=460889 Review URL: https://codereview.chromium.org/952533002 Cr-Commit-Position: refs/heads/master@{#317609}
* Absence of keyboard layout is fatal.kpschoedel2015-01-281-2/+2
| | | | | | | | R=spang Review URL: https://codereview.chromium.org/880283003 Cr-Commit-Position: refs/heads/master@{#313596}
* [Ozone] Fix ui::Event::GetCharacter() when Ctrl is pressedpkotwicz2015-01-271-0/+7
| | | | | | | | | | | | | On X11, ui::Event::GetCharacter() returns 0x0 when the correct return value when control is pressed is unclear (e.g. Ctrl+[). This CL makes Ozone follow the same behavior. BUG=450849 TEST=Manual, see bug Review URL: https://codereview.chromium.org/872213002 Cr-Commit-Position: refs/heads/master@{#313366}
* Ozone: Build fix on Linux.kalyan.kondapally2015-01-191-0/+2
| | | | | | | | | Clang complains about un-used funtions on Linux builds. This CL fixes it. Review URL: https://codereview.chromium.org/841113004 Cr-Commit-Position: refs/heads/master@{#312121}
* ozone: xkb: Fix deletion of malloc'd string with deletespang2015-01-171-9/+11
| | | | | | | | | | | | | | | This fixes a crash with the debug allocator: memory allocation/deallocation mismatch at 0x1276ec6e3020: allocated with malloc being deallocated with delete Only debug builds are affected. BUG=none TEST=start chrome debug build on link_freon Review URL: https://codereview.chromium.org/843013007 Cr-Commit-Position: refs/heads/master@{#312041}
* ozone: Fix events_unittests build with use_xkbcommon==1robert.bradford2015-01-141-21/+21
| | | | | | | | | | | | | | | | In r311421 a test was modified that called into XkbKeyboardLayoutEngine::ParseLayoutName but this function was not exposed in the header file. This change exposes this method in the header file and fixes the build. Original CL that introduced issue: https://codereview.chromium.org/848833002 BUG=None TEST=Compile of events_unittests completes Review URL: https://codereview.chromium.org/812613004 Cr-Commit-Position: refs/heads/master@{#311523}
* 1. Adds null check when keymap is failed to load. 2. Moves xkb_rule_names ↵fengyuan2015-01-141-35/+40
| | | | | | | | | | construction into worker thread to fix crash problem. BUG=447415, 444121 Review URL: https://codereview.chromium.org/848833002 Cr-Commit-Position: refs/heads/master@{#311421}
* ozone: xkb: Load keymaps on worker thread & cache themfengyuan2015-01-081-22/+78
| | | | | | | | | | | | 1. Free xkb keymaps in the destructor. 2. Moves kemap load into another worker thread. 3. Adds keymap caching. BUG=430194 Review URL: https://codereview.chromium.org/842603002 Cr-Commit-Position: refs/heads/master@{#310448}
* ozone: xkb: Fix number pad key mappingsspang2015-01-061-2/+11
| | | | | | | | | | | | ChromeOS doesn't have toggleable num lock; it is always considered enabled. Always set num lock in the xkb modifier mask. BUG=34920 TEST=numpad on link_freon generates numbers Review URL: https://codereview.chromium.org/834373002 Cr-Commit-Position: refs/heads/master@{#310152}
* Ozone: Add KeyMap support on Non-ChromeOS builds.kalyan.kondapally2015-01-061-8/+14
| | | | | | | | | | | SetCurrentLayoutByName has needed support for ChromeOS. It would be nice to have needed non-ChromeOS support, so that other Ozone implementations can re-use all this work. This patch adds needed support for retrieving Key maps from the passed string. Review URL: https://codereview.chromium.org/822383002 Cr-Commit-Position: refs/heads/master@{#310110}
* Revert of ozone: xkb: Load keymaps on worker thread & cache them (patchset ↵spang2015-01-061-66/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | #17 id:310001 of https://codereview.chromium.org/817983002/) Reason for revert: Adds thread-unsafe code. Original issue's description: > ozone: xkb: Load keymaps on worker thread & cache them > > 1. Free xkb keymaps in the destructor. > 2. Moves kemap load into another worker thread. > 3. Adds keymap caching. > > BUG=430194 > > Committed: https://crrev.com/f0b38f78f146cedf336ac9ad0236f681833c7263 > Cr-Commit-Position: refs/heads/master@{#309928} TBR=shuchen@chromium.org,kpschoedel@chromium.org,fengyuan@chromium.org NOTREECHECKS=true NOTRY=true BUG=430194 Review URL: https://codereview.chromium.org/823633003 Cr-Commit-Position: refs/heads/master@{#310105}
* ozone: xkb: Load keymaps on worker thread & cache themfengyuan2015-01-051-15/+66
| | | | | | | | | | | | 1. Free xkb keymaps in the destructor. 2. Moves kemap load into another worker thread. 3. Adds keymap caching. BUG=430194 Review URL: https://codereview.chromium.org/817983002 Cr-Commit-Position: refs/heads/master@{#309928}
* XKB RMLVO splitting.kpschoedel2014-12-181-7/+10
| | | | | | | | | | | | Layouts with a variant part (e.g. "us(altgr-intl)") could not be selected. BUG=362698 TEST=manual on link_freon Review URL: https://codereview.chromium.org/813893002 Cr-Commit-Position: refs/heads/master@{#309050}
* Workaround for xkbcommon dead keys.kpschoedel2014-12-171-5/+7
| | | | | | | | | | | | | | | Dead key processing on ChromeOS currently depends on having X |KeySym| values in KeyEvent.platform_keycode(). This patch adds the 'platform keycode' (KeySym) to the Ozone layout interface. Since this introduces platform dependence, it needs to be reimplemented: crbug.com/442757 BUG=430194 R=sadrul TEST=manual on link_freon Review URL: https://codereview.chromium.org/808043002 Cr-Commit-Position: refs/heads/master@{#308850}
* Supports layout switch in Ozone by xkbcommon library.fengyuan2014-12-171-182/+27
| | | | | | | | BUG=430194 Review URL: https://codereview.chromium.org/811523003 Cr-Commit-Position: refs/heads/master@{#308697}
* Generate correct KeyboardCode (VKEY).kpschoedel2014-12-161-12/+682
| | | | | | | | BUG=430194 Review URL: https://codereview.chromium.org/786813004 Cr-Commit-Position: refs/heads/master@{#308469}
* Partial XKB implementation of Ozone key layout.kpschoedel2014-12-151-0/+358
No layout switching; uses a hard-coded US layout. BUG=430194 Review URL: https://codereview.chromium.org/778503002 Cr-Commit-Position: refs/heads/master@{#308447}