From 8328bd7be216b445c19fc9e330d3c94f58c7dc76 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 16 Jun 2021 19:00:11 +0200 Subject: [PATCH 1/2] HostOS: Migrate from OSX to macOS Apple started calling their operating system macOS, rather than OSX a while ago, and as such, we should follow suit. This introduces `::hostos::MACOS`, and makes `::OSX` an alias of it. All internal users were updated to refer to `::hostos::MACOS`, but the `::OSX` alias is being kept indefinitely. Signed-off-by: Gergely Nagy --- plugins/Kaleidoscope-HostOS/README.md | 9 ++++++--- .../Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/Kaleidoscope-HostOS/README.md b/plugins/Kaleidoscope-HostOS/README.md index 35534c1b..77fca3be 100644 --- a/plugins/Kaleidoscope-HostOS/README.md +++ b/plugins/Kaleidoscope-HostOS/README.md @@ -25,8 +25,8 @@ void someFunction(void) { if (HostOS.os() == kaleidoscope::hostos::LINUX) { // do something linux-y } - if (HostOS.os() == kaleidoscope::hostos::OSX) { - // do something OSX-y + if (HostOS.os() == kaleidoscope::hostos::MACOS) { + // do something macOS-y } } @@ -55,10 +55,13 @@ The extension provides the following methods on the `HostOS` singleton: The OS type (i.e. the return type of `.os()` and the arguments to `.os(type)`) will be one of the following: - `kaleidoscope::hostos::LINUX` - - `kaleidoscope::hostos::OSX` + - `kaleidoscope::hostos::MACOS` - `kaleidoscope::hostos::WINDOWS` - `kaleidoscope::hostos::OTHER` +For compability reasons, `kaleidoscope::hostos::OSX` is an alias to +`kaleidoscope::hostos::MACOS`. + ## Focus commands The plugin provides the `FocusHostOSCommand` object, which, when enabled, diff --git a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h index 3d9b4c36..bfff6944 100644 --- a/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h +++ b/plugins/Kaleidoscope-HostOS/src/kaleidoscope/plugin/HostOS.h @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- * Kaleidoscope-HostOS -- Host OS detection and tracking for Kaleidoscope - * Copyright (C) 2016, 2017, 2018 Keyboard.io, Inc + * Copyright (C) 2016-2021 Keyboard.io, Inc * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software @@ -25,7 +25,8 @@ namespace hostos { typedef enum { LINUX, - OSX, + MACOS, + OSX = MACOS, WINDOWS, OTHER, From e576b78ba7c7e6fabf6dad5ec54d9ad51abe7a4d Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 16 Jun 2021 19:03:52 +0200 Subject: [PATCH 2/2] Switch from using hostos::OSX to hostos::MACOS Signed-off-by: Gergely Nagy --- examples/Features/AppSwitcher/AppSwitcher.cpp | 2 +- .../src/kaleidoscope/plugin/Unicode.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Features/AppSwitcher/AppSwitcher.cpp b/examples/Features/AppSwitcher/AppSwitcher.cpp index e75c94bf..64845e61 100644 --- a/examples/Features/AppSwitcher/AppSwitcher.cpp +++ b/examples/Features/AppSwitcher/AppSwitcher.cpp @@ -40,7 +40,7 @@ EventHandlerResult AppSwitcher::onKeyEvent(KeyEvent &event) { // If AppSwitcher was not already active, hold its modifier first. if (!active_addr_.isValid()) { - if (::HostOS.os() == hostos::OSX) { + if (::HostOS.os() == hostos::MACOS) { event.key = Key_LeftGui; } else { event.key = Key_LeftAlt; diff --git a/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.cpp b/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.cpp index da4c2ce8..ef915fa8 100644 --- a/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.cpp +++ b/plugins/Kaleidoscope-Unicode/src/kaleidoscope/plugin/Unicode.cpp @@ -42,7 +42,7 @@ void Unicode::start(void) { kaleidoscope::Runtime.hid().keyboard().releaseRawKey(Key_KeypadAdd); kaleidoscope::Runtime.hid().keyboard().sendReport(); break; - case hostos::OSX: + case hostos::MACOS: kaleidoscope::Runtime.hid().keyboard().pressRawKey(Key_LeftAlt); break; default: @@ -56,7 +56,7 @@ void Unicode::input(void) { case hostos::LINUX: break; case hostos::WINDOWS: - case hostos::OSX: + case hostos::MACOS: kaleidoscope::Runtime.hid().keyboard().pressRawKey(Key_LeftAlt); break; default: @@ -75,7 +75,7 @@ void Unicode::end(void) { kaleidoscope::Runtime.hid().keyboard().sendReport(); break; case hostos::WINDOWS: - case hostos::OSX: + case hostos::MACOS: kaleidoscope::Runtime.hid().keyboard().releaseRawKey(Key_LeftAlt); kaleidoscope::Runtime.hid().keyboard().sendReport(); break;