             }()
             
             // measurement
-            let sideEdges = (isLandscape ? layoutConstants.sideEdgesPortrait(bounds.width) : layoutConstants.sideEdgesLandscape)
+            var sideEdges = (isLandscape ? layoutConstants.sideEdgesPortrait(bounds.width) : layoutConstants.sideEdgesLandscape)
+            
+            // measurement
+            let bottomEdge = sideEdges
+            
+            let normalKeyboardSize = bounds.width - CGFloat(2) * sideEdges
+            
+            // measurement
+            let shrunkKeyboardSize = layoutConstants.keyboardShrunkSize(normalKeyboardSize)
+            
+            sideEdges += ((normalKeyboardSize - shrunkKeyboardSize) / CGFloat(2))
 
             // measurement
             let topEdge: CGFloat = ((isLandscape ? layoutConstants.topEdgeLandscape : layoutConstants.topEdgePortrait(bounds.width)) + self.topBanner)

            
            // measurement
            let keyHeight: CGFloat = {
                let totalGaps = sideEdges + topEdge + (rowGaps * CGFloat(numRows - 1))
                return (bounds.height - totalGaps) / CGFloat(numRows)
            }()
            

            }()
            
            for (r, row) in enumerate(page.rows) {
                let frame = CGRectMake(sideEdges, topEdge + CGFloat(r) * (keyHeight + rowGaps), bounds.width - CGFloat(2) * sideEdges, keyHeight)
                self.handleRow(row, keyGaps: keyGaps, letterKeyWidth: letterKeyWidth, frame: frame)
            }
        }
