Commit Graph

78 Commits

Author SHA1 Message Date
Kovid Goyal
e8c683db8b A new approach to handling flagsChanged with IME
Bypass cocoa's flagsChanged handling and call handleevent ourselves,
this allows us to know exactly what the IME is doing. Hopefully fixes
issues with IMEs that change state on modifier key presses.

Fixes #4541
2022-01-22 14:47:57 +05:30
pagedown
5182f79152 macOS: Fix global shortcuts with shift modifier key not working 2022-01-17 02:23:00 +08:00
Kovid Goyal
06ff685f8e oops 2022-01-15 14:54:30 +05:30
Kovid Goyal
ca4840717b macOS: Fix using shortcuts from the global menu bar as subsequent key presses in a multi key mapping not working
Fixes #4519
2022-01-15 13:56:18 +05:30
Kovid Goyal
c473df4393 Ignore NSEventModifierFlagFunction when parsing global shortcuts 2022-01-15 12:16:18 +05:30
Kovid Goyal
aab121b35d Also check for shiftable shortcuts in the virtual key code case 2022-01-15 10:23:18 +05:30
Kovid Goyal
396906860d macOS: When checking for global shortcuts handle shifted form of cmd+` 2022-01-15 10:14:06 +05:30
pagedown
a9bdf70275 macOS: Watch for system preferences changes and update global_shortcuts 2022-01-14 13:51:46 +08:00
pagedown
ab5b9fb329 macOS: Only check the "standard" type of the system shortcuts 2022-01-14 10:07:38 +08:00
pagedown
e0700d45de macOS: Update to the latest and categorize the system shortcut names 2022-01-14 10:05:49 +08:00
Kovid Goyal
79fd01093a fix typo in generating lookup keys for vk code based shortcuts 2022-01-13 19:21:49 +05:30
Kovid Goyal
a56471f7ed Validate the parameters array 2022-01-13 16:44:43 +05:30
Kovid Goyal
96b46c554e Add type annotations to dictionaries 2022-01-13 16:29:13 +05:30
Kovid Goyal
a819023ab7 remove redundant cast 2022-01-13 16:05:48 +05:30
Kovid Goyal
9504f50bd4 ... 2022-01-13 16:04:50 +05:30
Kovid Goyal
8fe71e3dc8 Dont use a block for dictionary enumeration
Maybe that will fix the mysterious issue @page-down is having
2022-01-13 16:02:29 +05:30
Kovid Goyal
34d7643bed Ensure global_shosrtcuts is initialized 2022-01-13 15:10:19 +05:30
Kovid Goyal
682eb7d802 Log when events are ignored because no keyWindow is present 2022-01-13 14:22:52 +05:30
Kovid Goyal
f86a954131 ooops 2022-01-13 14:21:58 +05:30
Kovid Goyal
8e3f6d37d9 ... 2022-01-13 14:15:39 +05:30
Kovid Goyal
2c38360ca0 Handle no keyWindow case 2022-01-13 13:43:01 +05:30
Kovid Goyal
f9d2167c97 macOS: Respect the users system-wide global keyboard shortcut preferences
Note that we currently dont handle live reload of global shortcut
preferences. I cant be bothered. Patches welcome.
Fixes #4501
2022-01-13 13:36:58 +05:30
pagedown
8ed6ee97b2 Docs: replace http url with https, use ripgrep project url and fix typo 2021-11-30 18:53:58 +08:00
Kovid Goyal
0965fc45f2 macOS: Fix keyboard input not working after toggling traditional fullscreen till the window is clicked in 2021-11-13 14:20:18 +05:30
Luflosi
a1d24028b8 Fix Clang warning
Without this, kitty fails to compile:
```
glfw/cocoa_init.m:462:14: error: case value not in enumerated type
      'NSEventModifierFlags' (aka 'enum NSEventModifierFlags')
      [-Werror,-Wswitch]
        case (NSEventModifierFlagShift | NSEventModifierFlagOption):
             ^
glfw/cocoa_init.m:465:14: error: case value not in enumerated type
      'NSEventModifierFlags' (aka 'enum NSEventModifierFlags')
      [-Werror,-Wswitch]
        case (NSEventModifierFlagShift | NSEventModifierFlagCommand):
             ^
```
I thought about changing the type of the `modifierFlags` function parameter from `NSEventModifierFlags` to `NSUInteger` since `NSEventModifierFlags` is defined as an enum according to https://developer.apple.com/documentation/appkit/nseventmodifierflags?language=objc and is technically not the proper type for a bit field. But since Apple themselves define `modifierFlags` as `NSEventModifierFlags` according to https://developer.apple.com/documentation/appkit/nsevent/1534405-modifierflags?language=objc, I think the fix in this commit is better.
This warning was introduced with commit f9944e6140.
2021-10-30 16:25:20 +02:00
Kovid Goyal
f9944e6140 Pass through more modifier+tab variants 2021-10-17 11:31:54 +05:30
Kovid Goyal
f28d9bcd8c Change sybolic constant for insert key 2021-10-14 21:05:21 +05:30
Kovid Goyal
c6039fc399 Also passthrough Insert and Shift+Insert which cocoa seems to intercept 2021-10-14 20:27:22 +05:30
Kovid Goyal
820fb6dda9 Pass through all esc + modifier combinations since they arent generally used in macOS 2021-10-11 11:27:24 +05:30
Kovid Goyal
dc11b76bea Restrict the overridden cocoa global shortcuts 2021-10-11 06:46:59 +05:30
Kovid Goyal
2b9408c217 macOS: Fix ctrl or cmd with Esc or Function keys not working
Fixes #4109
2021-10-10 21:39:20 +05:30
Kovid Goyal
be34af4555 Remove inline from .c files
It is ignored by compilers and hides unused static functions
2021-08-03 09:11:17 +05:30
Kovid Goyal
399c700939 Prevent Cocoa from sending us open file events from command line args
We process command line args ourselves, thank you very much.
2021-03-11 10:59:03 +05:30
Kovid Goyal
077097c112 Also implement openFiles 2021-03-10 21:55:00 +05:30
Kovid Goyal
f70c9842f5 macOS: Allow opening script and command
Fixes #3366
2021-03-10 21:33:29 +05:30
Kovid Goyal
86ce72e725 Port the Cocoa backend to use unicode key numbers 2021-01-16 20:52:16 +05:30
Luflosi
785973bb5e GLFW: Make joystick platform code init on demand
From upstream: 782e6b6cef.
2020-07-23 23:56:30 +02:00
Kovid Goyal
03b1484c96 Wayland: Abort on fatal error should bypass quit confirmation 2020-06-03 14:39:27 +05:30
Kovid Goyal
707cb37212 Have the confirm on close also apply to quitting kitty
Use a dedicated API for handling quit requests on macOS rather than a
quit canary. Also create a mappable "quit" action for all platforms.
2020-05-18 16:06:40 +05:30
Luflosi
e4fd12001c Cocoa: Add fully dynamic loading of Vulkan loader
From upstream: 7da87aaae7.
2020-01-17 14:18:28 +01:00
Kovid Goyal
87e2f7f86d Missed a couple of macOS timer calls 2019-12-19 16:34:47 +05:30
Luflosi
2804e1ff81 Cocoa: Update outdated comment
From upstream: b3544ca43e.
2019-12-18 15:41:31 +01:00
Luflosi
4fc733a9c8 Comment commented out code back in
This piece of code is not run when the `GLFW_COCOA_MENUBAR` init hint is set to `0`, which kitty does.
This reduces the difference to GLFW upstream a little.
2019-11-24 13:29:06 +01:00
Luflosi
f9fd39b8c1 Create macOS menu bar where GLFW creates it
GLFW creates the menu bar in the applicationWillFinishLaunching method, while kitty creates it in `create_os_window()`. This patch changes the behaviour to match GLFW.
In practice, without this change, there can be a short time where the menu bar is not fully populated.
2019-11-24 08:43:01 +01:00
Benoit de Chezelles
4d6472128c Rename scancode to keycode for cocoa implementation 2019-10-17 20:41:48 +02:00
Luflosi
7ddbb613fe Cocoa: Fix window creation blocking after re-init
From 2fbb560eb7.
2019-10-08 13:41:10 +02:00
Luflosi
1f8631cc99 Cocoa: Move app delegate and menu creation to init
From ea7eb2ddab.
2019-10-07 21:24:58 +02:00
Luflosi
f3b9ff5f9f Use datatype monotonic_t instead of double to keep track of time
The time is stored in a signed 64 bit integer with nanosecond accuracy. This eliminates the possibility of floating-point inaccuracies.
`monotonic_t` can currently hold values large enough to work correctly for more than 200 years into the future.
Using a typedef instead of directly using `int64_t` everywhere will also allow easily changing the datatype in the future should the need arise for more precise or bigger time values.
2019-09-25 17:43:11 +02:00
Luflosi
28bb123be8 Update the GLFW version number from 3.3 to 3.4
Closes https://github.com/kovidgoyal/kitty/issues/1884.
From a337c56848.
2019-08-02 11:00:16 -05:00
Luflosi
489f3e6c9d Add C dialect reminders to each glfw source file
Reduces the difference to upstream.
From 56aad76b16.
2019-07-20 21:07:27 -05:00