Code Monkey home page Code Monkey logo

Comments (3)

urob avatar urob commented on June 12, 2024

Unfortunately, without native ZMK support for unicode, it won't be possible to "hotswap" the OS. The best you can do is to create two separate layers with the corresponding unicode macros for each OS.

For instance, to create both Windows (WinCompose) and Linux versions of a unicode macro, you could do the following:

// activate Linux-mode for helper script
#undef OS_UNICODE_LEAD
#undef OS_UNICODE_TRAIL
#define OS_UNICODE_LEAD &macro_tap &kp LS(LC(U))  // <- Linux compose sequence
#define OS_UNICODE_TRAIL &macro_tap &kp SPACE  // <- Space terminates unicode input on Linux

// use helper-script to define linux unicode macros, e.g.,
ZMK_UNICODE_PAIR( lin_ae,   N0, N0,  E, N4,   N0, N0,  C, N4 )

// switch to Windows-mode (using WinCompose) for helper script
#undef OS_UNICODE_LEAD
#undef OS_UNICODE_TRAIL
#define OS_UNICODE_LEAD &macro_tap &kp RALT &kp U  // <- WinCompose sequence
#define OS_UNICODE_TRAIL &macro_tap &kp RET  // <- Return terminates unicode input on Windows

// use helper-script to define Windows unicode macros, e.g.,
ZMK_UNICODE_PAIR( win_ae,   N0, N0,  E, N4,   N0, N0,  C, N4 )

Once you have the unicode macros for both OS, you can add them to a "Linux" and "Windows" layer on your keymap, and then use &to to toggle between them.

from zmk-helpers.

urob avatar urob commented on June 12, 2024

Just for completeness, to activate macOS, you would do:

// activate macOS-mode for helper script
#undef OS_UNICODE_LEAD
#undef OS_UNICODE_TRAIL
#define OS_UNICODE_LEAD &macro_press &kp LALT  // <- macOS compose sequence (must be activated in system preferences)
#define OS_UNICODE_TRAIL &macro_release &kp LALT  // <- Releasing Left-Alt terminates unicode input on macOns

from zmk-helpers.

CrispyPin avatar CrispyPin commented on June 12, 2024

Thank you, I will try setting this up

from zmk-helpers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.