             }()
             
             // 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)

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

    static let topEdgePortraitWidthThreshholds: [CGFloat] = [350, 400]
    static let topEdgeLandscape: CGFloat = 6
    
    static let keyboardShrunkSizeArray: [CGFloat] = [522, 524]
    static let keyboardShrunkSizeWidthThreshholds: [CGFloat] = [700]
    static let keyboardShrunkSizeBaseWidthThreshhold: CGFloat = 600
    
    static let rowGapsPortrait: CGFloat = 15
    static let rowGapsLandscape: CGFloat = 7
    
