andreasgal/gaia — pull request #693 by mcmyt (2012-03-01 19:45:53+00:00)
Title: Added arabic keyboard and did some hacks 

Layout autors can change write direction (RTL & LTR), change switch keys texts ( Alternate, Basic Layout) & rewrite AlternateLayoutKeys

/**********************************************************************************************	CODES ADDED

***********************************************************************************************/

/*****************************************************************

File: keyboard.js ( lines: 717-721 )

*****************************************************************/

// This gives the author the ability to change the direction of the text
if ( Keyboards[ this.currentKeyboard ][ 'direction' ] == 'rtl')
this.targetWindow.style.direction = 'rtl'
else
this.targetWindow.style.direction = 'ltr';

/*****************************************************************

File: keyboard.js ( lines: 860-863 )

*****************************************************************/

// This gives layout author the ability to rewrite AlternateLayoutKeys
var hasSpecialCode = specialCodes.indexOf(key.keyCode) > -1;
if (!(key.keyCode < 0 || hasSpecialCode) && this.isAlternateLayout)
keyChar = Keyboards[ this.currentKeyboard ]['alternateLayoutOverwrite'][keyChar] || keyChar;

/*****************************************************************

File: keyboard.js ( lines: 884-896 )

*****************************************************************/

// This gives the author the ability to change the alternate layout switch key contents
var alternateLayoutKey = "?123";
if( Keyboards[ this.currentKeyboard ]['alternateLayoutKey'])
{
alternateLayoutKey = Keyboards[ this.currentKeyboard ]['alternateLayoutKey'];
}

// This gives the author the ability to change the basic layout switch key contents
var basicLayoutKey = "ABC";
if( Keyboards[ this.currentKeyboard ]['basicLayoutKey'])
{
basicLayoutKey = Keyboards[ this.currentKeyboard ]['basicLayoutKey'];
}

/***********************************************************************************************
CODES UPDATED
***********************************************************************************************/

/*****************************************************************

File: keyboard.js ( line: 906 )

*****************************************************************/

// Was
'?123',
// Became
alternateLayoutKey,

/*****************************************************************

File: keyboard.js ( line: 913 )

*****************************************************************/

// Was
'ABC',
// Became
basicLayoutKey,