Skip to content

Commit

Permalink
alternative english keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
MarZab committed Jul 13, 2014
1 parent dfc12f3 commit cf7256b
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 751 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/fxkeyboard*
7 changes: 0 additions & 7 deletions src/chrome.manifest
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
content fxkeyboard chrome/content/

locale fxkeyboard en-US chrome/locale/en-US/
locale fxkeyboard de-DE chrome/locale/de-DE/
locale fxkeyboard sl-SI chrome/locale/sl-SI/
locale fxkeyboard hr-HR chrome/locale/hr-HR/
locale fxkeyboard ru-RU chrome/locale/ru-RU/
locale fxkeyboard it-IT chrome/locale/it-IT/
locale fxkeyboard pl-PL chrome/locale/pl-PL/
locale fxkeyboard fr-FR chrome/locale/fr-FR/

overlay chrome://browser/content/browser.xul chrome://fxkeyboard/locale/overlay.xul
5 changes: 1 addition & 4 deletions src/chrome/content/overlay.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@

#fxKeyboardToolbar button {
min-width:1px;
font-family: mono;
}

.fxKeyboardActionKeys {
font-weight:bold;
}
44 changes: 19 additions & 25 deletions src/chrome/content/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var fxKeyboard = {
buttons[b].flex = 1;
}

this.shift = 0; // 0 closed, 1 open, 2 persistent
//this.shift = 0; // 0 closed, 1 open, 2 persistent
this.toolbar = document.getElementById('fxKeyboardToolbar');
this.mainKeys = document.getElementById('fxKeyboardMainKeys');
this.keys = this.mainKeys.getElementsByClassName('fxKeyboardKey');
Expand Down Expand Up @@ -88,11 +88,11 @@ var fxKeyboard = {
{
// press a key on the focused item
if (typeof(key)=='string') {
if (this.shift > 0) {
/*if (this.shift > 0) {
key = key.toUpperCase();
if ( this.shift<2 )
this.undoShift();
}
}*/
key = key.charCodeAt(0);
}

Expand All @@ -110,7 +110,7 @@ var fxKeyboard = {
evt.initKeyEvent("keypress", true, true, null, false, false, false, false, key, 0);
this.focus.dispatchEvent(evt);
},
undoShift: function () {
/*undoShift: function () {
fxKeyboard.shift = 0;
for( var k in fxKeyboard.keys) {
if (fxKeyboard.keys[k].label!==undefined)
Expand Down Expand Up @@ -145,33 +145,27 @@ var fxKeyboard = {
this.undoShift();
break;
}
},
switchAltKeys: function () {
},*/
switchAltKeys: function ( keep ) {
// reset shift
if ( this.shift > 0) {
/*if ( this.shift > 0) {
document.getElementById('fxKeyboardShift').style.color = 'inherit';
this.undoShift();
}
}*/

switch ( this.alt ) {
case 0:
// show alt
this.mainKeys.collapsed = true;
this.altKeys.collapsed = false;
this.alt = 1;
break;
case 1:
// keep alt
if (this.alt > 0) {
document.getElementById('fxKeyboardAlt').style.color = 'inherit';
this.mainKeys.collapsed = false;
this.altKeys.collapsed = true;
this.alt = 0;
} else {
this.mainKeys.collapsed = true;
this.altKeys.collapsed = false;
this.alt = 1;
if (keep) {
document.getElementById('fxKeyboardAlt').style.color = 'red';
this.alt = 2;
break;
default:
// show default
document.getElementById('fxKeyboardAlt').style.color = 'inherit';
this.mainKeys.collapsed = false;
this.altKeys.collapsed = true;
this.alt = 0;
break;
}
}
},
doClear: function() {
Expand Down
96 changes: 0 additions & 96 deletions src/chrome/locale/de-DE/overlay.xul

This file was deleted.

Loading

0 comments on commit cf7256b

Please sign in to comment.