# Ctrl + scroll for zoom not working from keyboard but working from mouse

**URL:** <https://community.keyboard.io/t/ctrl-scroll-for-zoom-not-working-from-keyboard-but-working-from-mouse/1649>\
**Category:** Help and Getting Started\
**Created:** [June 16, 2018, 6:58am UTC](https://community.keyboard.io/t/ctrl-scroll-for-zoom-not-working-from-keyboard-but-working-from-mouse/1649 "2018-06-16T06:58:52Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jamadagni](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jamadagni/32/2030_2.png) [@jamadagni](https://community.keyboard.io/u/jamadagni)\
**Post date:** [June 16, 2018, 11:34am UTC](https://community.keyboard.io/t/ctrl-scroll-for-zoom-not-working-from-keyboard-but-working-from-mouse/1649/3 "2018-06-16T11:34:50Z")

</div>

Thanks for your reply and help as always! I sorta adapted your code into the following inlined into the `macroAction` function (somehow I don’t like to clutter the individual macros into separate functions):

```auto
    case MACRO_ZOOM_IN:
        if (keyToggledOn(keyState))
        {
            handleKeyswitchEvent(Key_LeftControl, Macros.row, Macros.col, keyState);
            handleKeyswitchEvent(Key_mouseScrollUp, Macros.row, Macros.col, keyState);
        }
        break;

    case MACRO_ZOOM_OUT:
        if (keyToggledOn(keyState))
        {
            handleKeyswitchEvent(Key_LeftControl, Macros.row, Macros.col, keyState);
            handleKeyswitchEvent(Key_mouseScrollDn, Macros.row, Macros.col, keyState);
        }
        break;

```

---

_[View the full topic](https://community.keyboard.io/t/ctrl-scroll-for-zoom-not-working-from-keyboard-but-working-from-mouse/1649)._
