Skip to content

Commit ebdcac4

Browse files
use getter instead
1 parent 82c53d7 commit ebdcac4

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

desktop/wrapper/src/intercept_frontend_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn convert_layout_keys_to_shortcut(layout_keys: &Vec<LayoutKey>) -> Option<Short
218218
let mut key: Option<KeyCode> = None;
219219
let mut modifiers = Modifiers::default();
220220
for layout_key in layout_keys {
221-
match layout_key.key {
221+
match layout_key.key() {
222222
Key::Shift => modifiers |= Modifiers::SHIFT,
223223
Key::Control => modifiers |= Modifiers::CONTROL,
224224
Key::Alt => modifiers |= Modifiers::ALT,

editor/src/messages/input_mapper/utility_types/input_keyboard.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,16 @@ impl From<Key> for LayoutKey {
321321

322322
#[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize, specta::Type)]
323323
pub struct LayoutKey {
324-
pub key: Key,
324+
key: Key,
325325
label: String,
326326
}
327327

328+
impl LayoutKey {
329+
pub fn key(&self) -> Key {
330+
self.key
331+
}
332+
}
333+
328334
pub const NUMBER_OF_KEYS: usize = Key::_KeysVariantCount as usize - 1;
329335

330336
/// Only `Key`s that exist on a physical keyboard should be used.

0 commit comments

Comments
 (0)