From 19549f6e25b51bb6e3b3850804ace591a6d29809 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 28 Jun 2020 10:03:13 -0400 Subject: Be more consistent with Command key variable name. --- core/events.lua | 4 ++-- modules/textadept/macros.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/events.lua b/core/events.lua index 4a45b8ec..2def3686 100644 --- a/core/events.lua +++ b/core/events.lua @@ -160,7 +160,7 @@ local M = {} -- * _`shift`_: The "Shift" modifier key is held down. -- * _`ctrl`_: The "Control" modifier key is held down. -- * _`alt`_: The "Alt"/"Option" modifier key is held down. --- * _`meta`_: The "Command" modifier key on Mac OSX is held down. +-- * _`cmd`_: The "Command" modifier key on Mac OSX is held down. -- * _`caps_lock`_: The "Caps Lock" modifier is on. -- @field MARGIN_CLICK (string) -- Emitted when clicking the mouse inside a sensitive margin. @@ -253,7 +253,7 @@ local M = {} -- * _`shift`_: The "Shift" modifier key is held down. -- * _`ctrl`_: The "Control" modifier key is held down. -- * _`alt`_: The "Alt"/"Option" modifier key is held down. --- * _`meta`_: The "Command" modifier key on Mac OSX is held down. +-- * _`cmd`_: The "Command" modifier key on Mac OSX is held down. -- @field UPDATE_UI (string) -- Emitted after the view is visually updated. -- Arguments: diff --git a/modules/textadept/macros.lua b/modules/textadept/macros.lua index d02f8786..e83b6a8b 100644 --- a/modules/textadept/macros.lua +++ b/modules/textadept/macros.lua @@ -29,17 +29,17 @@ local function event_recorder(event) return function(...) macro[#macro + 1] = {event, ...} end end local event_recorders = { - [events.KEYPRESS] = function(code, shift, control, alt, meta) + [events.KEYPRESS] = function(code, shift, control, alt, cmd) -- Not every keypress should be recorded (e.g. toggling macro recording). -- Use very basic key handling to try to identify key commands to ignore. local key = code < 256 and string.char(code) or keys.KEYSYMS[code] if key then if shift and code >= 32 and code < 256 then shift = false end local key_seq = (control and 'c' or '') .. (alt and 'a' or '') .. - (meta and OSX and 'm' or '') .. (shift and 's' or '') .. key + (cmd and OSX and 'm' or '') .. (shift and 's' or '') .. key for i = 1, #ignore do if keys[key_seq] == ignore[i] then return end end end - macro[#macro + 1] = {events.KEYPRESS, code, shift, control, alt, meta} + macro[#macro + 1] = {events.KEYPRESS, code, shift, control, alt, cmd} end, [events.MENU_CLICKED] = event_recorder(events.MENU_CLICKED), [events.CHAR_ADDED] = event_recorder(events.CHAR_ADDED), -- cgit v1.2.3