GithubHelp home page GithubHelp logo

Comments (7)

MatrixManAtYrService avatar MatrixManAtYrService commented on May 22, 2024

I also would like to do this. They're talking about it at post #420 here:

https://geekhack.org/index.php?topic=41989.400

I tried using

  ACTION_LAYER_TAP_TOGGLE(1) 

instead of

   LT(1, TG(1))

But again I think there's a bit more to do, based on what jack said here: https://www.reddit.com/r/olkb/comments/3iaita/layout_tips_and_tricks/cydcx21

from qmk_firmware.

MatrixManAtYrService avatar MatrixManAtYrService commented on May 22, 2024

I got this working, for the most part. KC_FN# refers to the #th item in the fn_actions array, which calls tap toggle in the code below:

// ~/qmk_firmware/keyboard/ergodox_ez/keymaps/keymap_matrixman.c

// the defalut values are shown here, but changing them has no effect 
#define TAPPING_TERM 200 // tap toggle timeout (ms)
#define TAPPING_TOGGLE 5 // tap toggle count

#define SYMB 1 // symbol layer
#define NAV 2 // nav layer


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = KEYMAP(  // layer 0 : default                                     

// some rows omitted                                                       

KC_FN1, KC_FN2, KC_RGUI, KC_MENU, KC_RCTRL,                                

// more rows omitted                                                       

const uint16_t PROGMEM fn_actions[] = {                                    
    [1] = ACTION_LAYER_TAP_TOGGLE(SYMB),    // FN1 - Tap/Toggle Layer 1 (Symbols)
    [2] = ACTION_LAYER_TAP_TOGGLE(NAV)      // FN2 - Tap/Toggle Layer 2 (Nav)
};  

I'm not wise in the ways of preprocessor voodoo, so I don't have a good idea of why my changes to TAPPING_TERM or TAPPING_TOGGLE don't stick. If you don't care about how this will affect the behavior of your other keymaps, you can change the values globally here:

../../tmk_core/common/action_tapping.h

from qmk_firmware.

dragon788 avatar dragon788 commented on May 22, 2024

@MatrixManAtYrService I think that they also include other files that define those same variables, so I'd look for all the places they are set and see if you can determine the inheritance order.

from qmk_firmware.

mecanogrh avatar mecanogrh commented on May 22, 2024

Can't we have double tap for this? So hold=momentary, double tap=toggle and tap=you just got a free key!

from qmk_firmware.

jackhumbert avatar jackhumbert commented on May 22, 2024

@majutsushi You'd have to make a custom macro for that, but it's possible! See #57 for a quick example of using the timers. You'd probably want a counter variable to detect which tap is happening.

from qmk_firmware.

fuzzbomb avatar fuzzbomb commented on May 22, 2024

I noticed that the default keymap for Ergodox-EZ already has this behaviour working for KC_FN1, since 2739aa8. I discovered it by accident while using the keyboard. The Egodoz-EZ doesn't actually document this; it says the bottom right key is a temporary toggle only.

It uses an approach like @MatrixManAtYrService suggested on 1 Jan, but without messing with timing.

See https://github.com/jackhumbert/qmk_firmware/blob/master/keyboard/ergodox_ez/keymaps/default/keymap.c

from qmk_firmware.

jackhumbert avatar jackhumbert commented on May 22, 2024

Support for the chainability mentioned won't happen unfortunately - it'll need to be a custom function with process_record_user. Closing this for now.

from qmk_firmware.

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.