Units and spacing

User avatar
acolombo

13 Aug 2014, 13:24

I'm working on a vector template for designing keycaps, and I've come across a problem.
In the home row, the bottom row and the space bar row I can't figure out how to space the keys correctly using the standard units, always keeping the same space between each key, and keeping everything perfect.

I think this problem occurs always when making keyboards/keycaps/plates, so how is this problem usually corrected?

Here is the image of what I'm talking about
Image
as you can see around Enter, R Shift and the Spacebar there are empty spaces. Does the manufacturers usually resize a bit the keycaps, they "vertically distribute" the spaces so there is a bit more space between each key, or there is a simpler way I am so dumb I cannot see? Obviously the biggest problem here is the spacebar row.

I hope this question hasn't been asked a milion of times, thanks guys.

Findecanor

13 Aug 2014, 16:02

I think it would be easiest to count a key unit as 3/4"×3/4" and then remove 1/2 mm from around each keycap.
If you are making a case with a top, widen each hole also 1/2 mm in every direction to make the spacing between keys and case the same as the spacing between keys.

User avatar
Muirium
µ

13 Aug 2014, 16:46

I don't get this problem when plotting designs in a 0.25 unit grid:

Image

Real caps are indeed a sliver smaller than the units they sit inside, to prevent scraping. So when you gather loose caps on a flat surface, you see inconsistencies like your diagram. But not in the ideal case.

User avatar
acolombo

13 Aug 2014, 17:20

Findecanor wrote: I think it would be easiest to count a key unit as 3/4"×3/4" and then remove 1/2 mm from around each keycap.
If you are making a case with a top, widen each hole also 1/2 mm in every direction to make the spacing between keys and case the same as the spacing between keys.
So yeah, there was a simpler way I am so dumb I couldn't see.

Damn, that's so obvious, I don't know how I couldn't think of it :lol: Thanks. Problem solved!

jacobolus

15 Aug 2014, 09:51

If you’re using Adobe Illustrator, you can make a 'graphic style' which reduces the size of the object it's applied to by the amount that a typical keycap is smaller than the standard grid size, and applies rounded corners. Then you can draw your keycaps as the full 3/4" by 3/4" squares (or whatever rectangular size is appropriate for larger caps) and they will appear correct (and you can later expand the appearance if you need).

I would also recommend setting Illustrator to use a grid of .75" major gridlines, and 4 subdivisions per gridline. Then (a) you can see the grid in the background, and (b) you can turn on "snap to grid" and every time you start drawing a rectangle it will automatically fit in your grid.

I actually got fancier and added multiple fills and some gradients to my graphic style, so that when I draw rectangles they turn into something like this
Image
In the illustrator file for this, each keycap is literally just a single rectangle with a graphic style applied, plus one more text box the size of the rectangle, with the text moved around inside using text layout features.

With the grid, rulers, selected objects’ edges, and some additional guides showing:
Image

bpiphany

08 Sep 2014, 08:53

It took me a while to get the locations correct when I started out designing layouts. In short the spacing between the center of two keys needs to be the average of their widths. So for example between a 1.50u TAB and 1.00u Q the distance is (1.50u+1.00u)/2 = 1.25u, or 0.9375" in real world "units", or 23.8125mm in real real world units. That's not too complicated, the fun starts when you try to figure out the location of the first key in the row. I prefer to put my origo at the center of the escape key (or some other 1.00u key in the first column) then any other key in the first column needs to be shifted to the right with half of what it is wider than a 1.00u key. So for example the TAB key needs to be shifted (1.50u-1.00u)/2 = 0.25u = 0.1875" = 4.7625mm to the right compared to ESC.

There, hope that helps anyone... (=

Post Reply

Return to “Workshop”