# Why is KeyboardioScanner separate from Kaleidoscope-Hardware-Model01?

**URL:** https://community.keyboard.io/t/why-is-keyboardioscanner-separate-from-kaleidoscope-hardware-model01/942
**Category:** Kaleidoscope Internals
**Tags:** question
**Created:** [January 16, 2018, 5:50pm UTC](https://community.keyboard.io/t/why-is-keyboardioscanner-separate-from-kaleidoscope-hardware-model01/942 "2018-01-16T17:50:04Z")
**Posts on this page:** 6
**Page:** 1

<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: [January 16, 2018, 5:50pm UTC](https://community.keyboard.io/t/why-is-keyboardioscanner-separate-from-kaleidoscope-hardware-model01/942/1 "2018-01-16T17:50:04Z")

</div>

I’ve been continuing to pull the threads that I find in the code, and I’m starting to wonder why the KeyboardioScanner repository is separate from the Kaleidoscope-Hardware-Model01 repository, rather than being a part of it. @algernon, can you explain it to me?

---

<div class="post-metadata">

### Author: ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)
#### Post date: [January 16, 2018, 6:12pm UTC](https://community.keyboard.io/t/why-is-keyboardioscanner-separate-from-kaleidoscope-hardware-model01/942/2 "2018-01-16T18:12:19Z")

</div>

Because it can be used separately, as in [by a different keyboard](https://github.com/Dygmalab/Kaleidoscope-Hardware-Raise/blob/master/src/Kaleidoscope-Hardware-Raise.h#L6). Perhaps its name is not the best, as it suggests it is tied to the Keyboardio, while it is not. It implements a particular way to do scanning and other things, but can be re-used by other hardware plugins, too.

(Raise currently uses a fork, but we could easily merge the two and support both keyboards. I’ll get there, eventually.)

---

<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: [January 16, 2018, 6:29pm UTC](https://community.keyboard.io/t/why-is-keyboardioscanner-separate-from-kaleidoscope-hardware-model01/942/3 "2018-01-16T18:29:06Z")

</div>

Thanks for the answer. I guess that makes sense, though it does make it difficult to follow code in Kaleidoscope-Hardware-Model01, because some of its data structures are defined in a different repository.

Does KeyboardioScanner require the same hardware for the key scanners that are used in the Model01? I’m still not sure where the code for those resides.

---

<div class="post-metadata">

### Author: ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)
#### Post date: [January 17, 2018, 4:08am UTC](https://community.keyboard.io/t/why-is-keyboardioscanner-separate-from-kaleidoscope-hardware-model01/942/4 "2018-01-17T04:08:11Z")

</div>

no. it just requires the same protocol.

It’s not uncommon for code that uses an API to require a library that exports the API. arguably, we should have methods to keep the data structures private.

---

<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: [January 17, 2018, 4:50am UTC](https://community.keyboard.io/t/why-is-keyboardioscanner-separate-from-kaleidoscope-hardware-model01/942/5 "2018-01-17T04:50:09Z")

</div>

> [@jesse](#):
>
> It’s not uncommon for code that uses an API to require a library that exports the API.

I started by (re-)examining Kaleidoscope-Hardware-Model01, and noticing that it did not, on its own, provide the whole API offered by Kaleidoscope-Hardware. It wasn’t the KeyboardioScanner API that I was looking at.

I haven’t worked out the details yet, but it seems to me that it would make more sense to use the same mechanism for making a module swappable in both this case and on the HID side, which seems to be going in a very different direction.

---

<div class="post-metadata">

### Author: ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)
#### Post date: [January 17, 2018, 4:52am UTC](https://community.keyboard.io/t/why-is-keyboardioscanner-separate-from-kaleidoscope-hardware-model01/942/6 "2018-01-17T04:52:18Z")

</div>

That’s a reasonable point, but a different thread 😉

There may be C++ reasons it’s not plausible, but i’m not sure either way at this point. It’d be nice to have consistent patterns.
