Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for azerty #974

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Sources/AppBundle/config/keysMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func getKeysPreset(_ layout: KeyMapping.Preset) -> [String: Key] {
return switch layout {
case .qwerty: keyNotationToKeyCode
case .dvorak: dvorakMap
case .azerty: azertyMap
}
}

Expand Down Expand Up @@ -196,6 +197,16 @@ private let dvorakMap: [String: Key] = keyNotationToKeyCode + [
z: .slash,
]

private let azertyMap: [String: Key] = keyNotationToKeyCode + [
a: .q,
q: .a,
z: .w,
w: .z,
m: .semicolon,
comma: .m,
semicolon: .comma
]

let modifiersMap: [String: NSEvent.ModifierFlags] = [
"shift": .shift,
"alt": .option,
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppBundle/config/parseKeyMapping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ private let keyMappingParser: [String: any ParserProtocol<KeyMapping>] = [

struct KeyMapping: Copyable, Equatable {
enum Preset: String, CaseIterable {
case qwerty, dvorak
case qwerty, dvorak, azerty
}

public init(
Expand Down
2 changes: 1 addition & 1 deletion docs/config-examples/default-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
# Also see: https://nikitabobko.github.io/AeroSpace/goodies#disable-hide-app
automatically-unhide-macos-hidden-apps = false

# Possible values: (qwerty|dvorak)
# Possible values: (qwerty|dvorak|azerty)
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
[key-mapping]
preset = 'qwerty'
Expand Down
Loading