Debugging a keystroke problem

Tudor Girba
feenk
Published in
2 min readFeb 12, 2019

In a previous story, we talked about how we built a dedicated tool to track visually the keyboard events. At that time we used that tool to debug and test the translation of events coming from the native window support

A visual logical keyboard simulation.

Soon after that, we stumbled across another problem. It appears that when Glamorous Toolkit was embedded inside the intertwined logic of Morphic, pressing some key combinations would be transformed into something else. In particular, pressing ] would work fine, but pressing Shift+] would move the cursor to the left. Something seemed amiss with how events were propagated.

So, we started to debug the issue as seen below. We use the real keyboard (bottom left) to generate the events, and we watched what the logical keyboard from our system told us. Sure enough, pressing ] worked fine, but pressing Shift+] was transformed into Shift+LeftArrow.

Comparing the key events from the real keyboard (bottom left) with the simulated keyboard (top right).

This is a typical story of moldable development. We build tools to expose problems before we tackle them. On the one hand, the tool investment pays off for each individual problem. On the other hand, these tools accumulate over time. In this case, we merely used the tool that we previously built.

The sum of all these custom tools leads to a new property in our systems: explainability.

Explainability is different than maintainability or evolvability. Explainability refers to our ability to explain a phenomenon in a way that both we and someone else can understand and relate to within minutes.

It’s hard to describe in words how working like this feels like.

We can easily talk about the measurable part of how quickly we can solve the bug. In this case, it took less than half an hour to understand the root of the problem and perhaps another half an hour to produce the fix for the problem. This is rather fast given that we are talking about the interaction of multiple low-level technologies.

But, the more interesting part comes from the less measurable part. From the way this feels. From the way it makes problems that would otherwise be out of reach become approachable. From knowing that any problem can be exposed elegantly. And from the confidence that it brings with it.

--

--

Tudor Girba
feenk
Editor for

CEO | Software Environmentalist @feenkcom. Making software systems explainable.