export type KeyboardLayout = Array < Array < string > > ; export const alphaNumericKeyboard = [ [ '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' ] , [ 'q' , 'w' , 'e' , 'r' , 't' , 'y' , 'u' , 'i' , 'o' , 'p' ] , [ 'a' , 's' , 'd' , 'f' , 'g' , 'h' , 'j' , 'k' , 'l' , 'Backspace' ] , [ 'Escape' , 'CapsLock' , 'z' , 'x' , 'c' , 'v' , 'b' , 'n' , 'm' , 'Enter' ] ] ; export const extendedKeyboard = [ [ '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' ] , [ 'q' , 'w' , 'e' , 'r' , 't' , 'y' , 'u' , 'i' , 'o' , 'p' ] , [ 'a' , 's' , 'd' , 'f' , 'g' , 'h' , 'j' , 'k' , 'l' , 'Backspace' ] , [ 'CapsLock' , 'z' , 'x' , 'c' , 'v' , 'b' , 'n' , 'm' , '-' , 'CapsLock' ] , [ 'Escape' , '@' , '#' , '     ' , '.' , 'Enter' ] ] ; export const numericKeyboard = [ [ 'Escape' , '-' , 'Backspace' ] , [ '7' , '8' , '9' ] , [ '4' , '5' , '6' ] , [ '1' , '2' , '3' ] , [ '0' , '.' , 'Enter' ] ] ; export function kyeboardCapsLockLayout ( layout , caps ) { return layout . map ( ( row ) : Array < string > => { return row . map ( ( key ) : string => { return ( key . length === 1 ) ? ( caps ? key . toUpperCase ( ) : key . toLowerCase ( ) ) : key ; } ) ; } ) ; }