Browse Source
Merge pull request #6268 from AvaloniaUI/6195-macos-text-shortcuts
Fix existing and add missing osx-specific key shortcuts
pull/6379/head
Max Katz
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
src/Avalonia.Native/AvaloniaNativePlatform.cs
|
|
|
@ -109,11 +109,17 @@ namespace Avalonia.Native |
|
|
|
.Bind<IRenderLoop>().ToConstant(new RenderLoop()) |
|
|
|
.Bind<IRenderTimer>().ToConstant(new DefaultRenderTimer(60)) |
|
|
|
.Bind<ISystemDialogImpl>().ToConstant(new SystemDialogs(_factory.CreateSystemDialogs())) |
|
|
|
.Bind<PlatformHotkeyConfiguration>().ToConstant(new PlatformHotkeyConfiguration(KeyModifiers.Meta)) |
|
|
|
.Bind<PlatformHotkeyConfiguration>().ToConstant(new PlatformHotkeyConfiguration(KeyModifiers.Meta, wholeWordTextActionModifiers: KeyModifiers.Alt)) |
|
|
|
.Bind<IMountedVolumeInfoProvider>().ToConstant(new MacOSMountedVolumeInfoProvider()) |
|
|
|
.Bind<IPlatformDragSource>().ToConstant(new AvaloniaNativeDragSource(_factory)) |
|
|
|
.Bind<IPlatformLifetimeEventsImpl>().ToConstant(applicationPlatform); |
|
|
|
|
|
|
|
var hotkeys = AvaloniaLocator.Current.GetService<PlatformHotkeyConfiguration>(); |
|
|
|
hotkeys.MoveCursorToTheStartOfLine.Add(new KeyGesture(Key.Left, hotkeys.CommandModifiers)); |
|
|
|
hotkeys.MoveCursorToTheStartOfLineWithSelection.Add(new KeyGesture(Key.Left, hotkeys.CommandModifiers | hotkeys.SelectionModifiers)); |
|
|
|
hotkeys.MoveCursorToTheEndOfLine.Add(new KeyGesture(Key.Right, hotkeys.CommandModifiers)); |
|
|
|
hotkeys.MoveCursorToTheEndOfLineWithSelection.Add(new KeyGesture(Key.Right, hotkeys.CommandModifiers | hotkeys.SelectionModifiers)); |
|
|
|
|
|
|
|
if (_options.UseGpu) |
|
|
|
{ |
|
|
|
try |
|
|
|
|