Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K KTextEditor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FrameworksFrameworks
  • KTextEditor
  • Merge requests
  • !291

vimode: fix swapped modifiers and arrow keys in insert/replace modes on macOS

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Georg Gadinger requested to merge ggadinger/ktexteditor:fix-vimode-modifiers-on-macos into master Feb 21, 2022
  • Overview 20
  • Commits 4
  • Pipelines 10
  • Changes 14

On macOS, Qt uses the Qt::ControlModifier for the ⌘ Command keys and the Qt::MetaModifier for the ⌃ Control keys, so these need to be swapped to make them work. In addition to that, the arrow keys have the Qt::KeypadModifier set. This behaviour is documented in the Qt::KeyboardModifier enum.

This is one issue on macOS builds that was annoying me enough to look a bit deeper into it :-) I hope the fix is good enough, I'm not sure where to nicely place the #ifdefs though (some commonly used header file would be nice, maybe src/vimode/definitions.h? Please let me know what you think).

I ran the vimode_* unit tests on both my MacBook and some Linux machine, they currently fail because of some assertion introduced with another recent change of the status bar handling. Commenting out that assertion lets the unit tests run through with the same failures on both machines (except for the vimode_completion one, there I get 2 passed, 379 failed, 0 skipped, 0 blacklisted, 463ms. I guess this needs some more work in general to work nicely on macOS).

Edited Feb 21, 2022 by Georg Gadinger
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-vimode-modifiers-on-macos