This repository has been archived by the owner on Dec 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9a920f
commit 3c6c208
Showing
8 changed files
with
101 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from typing import Tuple | ||
|
||
from evdev.events import KeyEvent | ||
|
||
import host | ||
import mapper | ||
from action.action_type import ActionType | ||
from action.mod_key_action import ModKeyAction | ||
from log import debug | ||
|
||
|
||
class LayerModAction: | ||
type: ActionType | ||
layer: int | ||
modifiers: Tuple[int, ...] | ||
|
||
def __init__(self, layer, *modifiers): | ||
self.type = ActionType.LayerOnAction | ||
self.layer = layer | ||
self.modifiers = modifiers | ||
|
||
def handle(self, ui, e, config, *args): | ||
debug('-- handling layer mod action --') | ||
for m in self.modifiers: | ||
host.write_code(ui, m, e.value) | ||
if e.value == KeyEvent.key_down: | ||
mapper.enable_layer(self.layer, self, config) | ||
else: | ||
mapper.disable_layer(ui, self.layer, config) | ||
|
||
def handle_layer_key(self, ui, key, e, *args): | ||
debug('-- handling LM layer key --') | ||
ModKeyAction(key, *self.modifiers).handle(ui, e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import List | ||
|
||
|
||
class Layer: | ||
keymap: List[int] | ||
activator: object | ||
|
||
def __init__(self, keymap, activator): | ||
self.keymap = keymap | ||
self.activator = activator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters