Giter Site home page Giter Site logo

zmk-num-word's Introduction

ZMK-NUM-WORD

Implement urob's num-word behavior for ZMK.

This is proof of concept that shows that without maintaining fork, new behavior can be implemented.

This implementation supports latest Zephyr 3.5 release with ZMK.

How to use this module?

Under config/west.yml add remotes and projects, here is an example of full file.

manifest:
  remotes:
    - name: zmkfirmware
      url-base: https://github.com/zmkfirmware
    - name: dhruvinsh
      url-base: https://github.com/dhruvinsh
  projects:
    - name: zmk
      remote: zmkfirmware
      revision: main
      import: app/west.yml
    - name: zmk-num-word
      remote: dhruvinsh
      revision: main
  self:
    path: config

NOTE: common use-case is define.

Summary

The num word behavior behaves similar to a cap word, but will automatically deactivate when any key not in a continue list is pressed, or if the num word key is pressed again. For smaller keyboards using mod-taps, this can help avoid repeated alternating holds when typing numbers.

The modifiers are applied only to to the number (0 to 9) keycodes.

Behavior Binding

  • Reference: &num_word

Example:

&num_word

NOTE: Make sure you have custom behavior called num_word create, see above guide.

Configuration

Default behavior (need to assign layer) defined as,

/ {
    behaviors {
      num_word: num_word {
        #binding-cells = <0>;
        compatible = "zmk,behavior-num-word";
        continue-list = <BSPC DEL DOT COMMA PLUS MINUS STAR FSLH EQUAL>;
        ignore-numbers;
    };
  };
};

To use default behavior (do not forget to use include),

#include <behaviors/num_word.dtsi>

&num_word {
  layers = <1 2 3>;
}

To create new behavior,

#include <dt-bindings/zmk/keys.h>

/ {
    behaviors {
      new_num_word: new_num_word {
        #binding-cells = <0>;
        compatible = "zmk,behavior-num-word";
        layers = <1 2 3>;
        continue-list = <BSPC EQUAL>;
        ignore-numbers;
    };
  };
};

Once this define, &new_num_word can be use in keymap.

Continue List

By default, the num word will remain active when any numeric character or BSPC, DEL, DOT, COMMA, PLUS, MINUS, STAR, FSLH, EQUAL characters are pressed (see above definition). Any other non-modifier keycode sent will turn off num word. If you would like to override this, you can set a new array of keys in the continue-list property in your keymap:

&num_word {
    continue-list = <UNDERSCORE MINUS>;
};

/ {
    keymap {
        ...
    };
};

Credits

Other Project

zmk-num-word's People

Contributors

dhruvinsh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.