cubiq / kbedit

Keyboard Designer
GNU General Public License v3.0
18 stars 6 forks source link

Intelligent key positioning for staggered rows #3

Open Daniel-Beardsmore opened 9 years ago

Daniel-Beardsmore commented 9 years ago

Currently, all new keys are snapped to the major (1u) grid. Support for stagger is poor, as you can't ever insert keys in their correction locations on most rows.

Worse, the program allows for a key to be inserted directly on top of another key, so that the first key vanishes.

One way to work around this is to detect overlap and insert the new key directly to its right. That way, all you need to do for a whole row of keys that are offset by stagger, is draw the large key (e.g. ctrl/caps lock), point at it, and press 1 repeatedly: all the remaining keys will be added to the next available space to the right of the key under the mouse cursor.

cubiq commented 9 years ago

this is planned. I believe I will add the key to the right and then to the bottom (if there's no more room).

I tried to remove the grid/snap, but it becomes a pain to align keys.

Daniel-Beardsmore commented 9 years ago

Almost works. Steps to reproduce the edge case:

1) Press 1 to create a key 2) Move the key so that it is half-way between two major grid squares (x+0.5 u) 3) Position the cursor over the right-hand side of the key and press 1: behaves as expected 4) Position the cursor over the left-hand side of the key and press 1: the new key is created in the left-hand major grid square that the key occupies, partially overlapping the key created in step 1