Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,552
    • Issues 1,552
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 218
    • Merge requests 218
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gtkgtk
  • Merge requests
  • !991

Use native Windows API for converting keystrokes to characters

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Isopod requested to merge Isopod/gtk:win32-native-input into gtk-3-24 Jul 11, 2019
  • Overview 28
  • Commits 4
  • Pipelines 4
  • Changes 6

GTK on Windows currently uses its own incomplete emulation for converting keystrokes into characters. This leads to some problems of GTK applications not behaving as a Windows user would expect.

The correct way to handle keyboard input on Windows is to call TranslateMessage() and interpret the WM_CHAR messages sent by Windows. This way a GTK application will behave exactly like a native Windows application, including all the nasty edgecases like modifier combinations, dead keys and so forth. This is exactly what this merge request does.

I built my changes on top of the IME input module, since I would have to handle those messages anyway and there was no point in reinventing the wheel. Hence I made the IME module the default for all locales.

It works perfectly for me. I have tested my changes with

  • German keyboard layout
  • NEO 2 German keyboard layout (it has special modifier keys)
  • American layout
  • Japanese IME (I don't speak Japanese, but it seems to be working correctly as far as I can tell)

This merge request fixes the following issues:

  • #2017 (closed) Upper layers of NEO keyboard layout not working on Windows
  • #2018 (closed) GTK3 on Windows doesn't handle Ctrl+Alt+<key> correctly
  • #478 (closed) No possibility to enter characters by Alt+Numpad sequences
  • #1428 (closed) Ligatures ignored on input on Windows
Edited Aug 02, 2019 by Isopod
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: win32-native-input