# OneShot seems to be broken (Is it due to broken key switch?)

**URL:** <https://community.keyboard.io/t/oneshot-seems-to-be-broken-is-it-due-to-broken-key-switch/4113>\
**Category:** Help and Getting Started\
**Tags:** plugin\
**Created:** [September 24, 2020, 8:57pm UTC](https://community.keyboard.io/t/oneshot-seems-to-be-broken-is-it-due-to-broken-key-switch/4113 "2020-09-24T20:57:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxG](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@MaxG](https://community.keyboard.io/u/MaxG)\
**Post date:** [September 24, 2020, 8:57pm UTC](https://community.keyboard.io/t/oneshot-seems-to-be-broken-is-it-due-to-broken-key-switch/4113/1 "2020-09-24T20:57:12Z")

</div>

This is very similar to [Oneshot is broken](https://community.keyboard.io/t/oneshot-is-broken/3895).

I compile OneShot using the ArduinoIDE. It compiles fine and I can flash the resulting firmware. I then can enter some text, including uppercase letters. However, OneShot behaviour does not work (`Shift, A` instead of `Shift+A`).

My `Key_V` has a broken key switch I did not fix so far. Most of the time the key switch does not send any signal. I disabled it using `XXX`. Could the broken OneShot be due to the disfunct switch? I would like to “repair” the plugin without having to repair the switch for the moment.

Does anyone know more about that OneShot behaviour?

Thank you very much.

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [September 24, 2020, 10:26pm UTC](https://community.keyboard.io/t/oneshot-seems-to-be-broken-is-it-due-to-broken-key-switch/4113/2 "2020-09-24T22:26:46Z")

</div>

It could be caused by the bad switch, but if it’s not causing any output (while you have it mapped to `Key_V`), that’s unlikely. It could be caused by an interaction with other plugins. Are you able to share your whole sketch? That would make debugging much easier.

---

<div class="post-metadata">

**Author:** ![MaxG](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@MaxG](https://community.keyboard.io/u/MaxG)\
**Post date:** [September 25, 2020, 6:58am UTC](https://community.keyboard.io/t/oneshot-seems-to-be-broken-is-it-due-to-broken-key-switch/4113/3 "2020-09-25T06:58:05Z")

</div>

Sorry, I wasn’t clear enough.

The problem remains even when I use the OneShot example layout.  
My current layout can be found at [https://github.com/MaxG87/Model01-Firmware](https://github.com/MaxG87/Model01-Firmware). It too suffers from not working OneShot.

To give a bit of context: The now broken key switch worked before a vacation and did not after it. Before the vacation OneShot worked. After I adapted the layout for the broken switch, OneShot did not work anymore. Unfortunately, I did not pay attention on whether it worked in between.

---

<div class="post-metadata">

**Author:** ![MaxG](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@MaxG](https://community.keyboard.io/u/MaxG)\
**Post date:** [October 12, 2020, 7:18am UTC](https://community.keyboard.io/t/oneshot-seems-to-be-broken-is-it-due-to-broken-key-switch/4113/4 "2020-10-12T07:18:38Z")

</div>

I tried to fix the key switch by replacing the upper half. By this, I broke it completely. Now OneShot works again.

So I guess a broken key switch infers with OneShot even if it does not send key presses all the time.

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [October 12, 2020, 12:58pm UTC](https://community.keyboard.io/t/oneshot-seems-to-be-broken-is-it-due-to-broken-key-switch/4113/5 "2020-10-12T12:58:20Z")

</div>

This makes sense. The faulty switch was still toggling its state, which ended up calling plugin event handlers with the value `Key_NoKey`, and OneShot wasn’t seeing that as a keypress, even though it would produce no output.
