зеркало из https://github.com/mozilla/gecko-dev.git
Bug 918598 - Support touch typing. r=marcoz r=davidb
This commit is contained in:
Родитель
0e6d40bfbc
Коммит
6c5e9dfafa
|
@ -735,6 +735,9 @@ var Input = {
|
|||
case 'swipeleft1':
|
||||
this.moveCursor('movePrevious', 'Simple', 'gesture');
|
||||
break;
|
||||
case 'exploreend1':
|
||||
this.activateCurrent(null, true);
|
||||
break;
|
||||
case 'swiperight2':
|
||||
this.sendScrollMessage(-1, true);
|
||||
break;
|
||||
|
@ -875,12 +878,13 @@ var Input = {
|
|||
mm.sendAsyncMessage(type, aDetails);
|
||||
},
|
||||
|
||||
activateCurrent: function activateCurrent(aData) {
|
||||
activateCurrent: function activateCurrent(aData, aActivateIfKey = false) {
|
||||
let mm = Utils.getMessageManager(Utils.CurrentBrowser);
|
||||
let offset = aData && typeof aData.keyIndex === 'number' ?
|
||||
aData.keyIndex - Output.brailleState.startOffset : -1;
|
||||
|
||||
mm.sendAsyncMessage('AccessFu:Activate', {offset: offset});
|
||||
mm.sendAsyncMessage('AccessFu:Activate',
|
||||
{offset: offset, activateIfKey: aActivateIfKey});
|
||||
},
|
||||
|
||||
sendContextMenuMessage: function sendContextMenuMessage() {
|
||||
|
|
|
@ -428,10 +428,10 @@ TouchPoint.prototype = {
|
|||
}
|
||||
|
||||
// To be considered an explore...
|
||||
if (!this.done &&
|
||||
duration > TouchAdapter.SWIPE_MAX_DURATION &&
|
||||
if (duration > TouchAdapter.SWIPE_MAX_DURATION &&
|
||||
(this.distanceTraveled / this.dpi) > TouchAdapter.TAP_MAX_RADIUS) {
|
||||
return {type: 'explore', x: this.x, y: this.y};
|
||||
return {type: this.done ? 'exploreend' : 'explore',
|
||||
x: this.x, y: this.y};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -31,6 +31,7 @@ const ROLE_CHECK_MENU_ITEM = Ci.nsIAccessibleRole.ROLE_CHECK_MENU_ITEM;
|
|||
const ROLE_PASSWORD_TEXT = Ci.nsIAccessibleRole.ROLE_PASSWORD_TEXT;
|
||||
const ROLE_RADIO_MENU_ITEM = Ci.nsIAccessibleRole.ROLE_RADIO_MENU_ITEM;
|
||||
const ROLE_TOGGLE_BUTTON = Ci.nsIAccessibleRole.ROLE_TOGGLE_BUTTON;
|
||||
const ROLE_KEY = Ci.nsIAccessibleRole.ROLE_KEY;
|
||||
const ROLE_ENTRY = Ci.nsIAccessibleRole.ROLE_ENTRY;
|
||||
const ROLE_LIST = Ci.nsIAccessibleRole.ROLE_LIST;
|
||||
const ROLE_DEFINITION_LIST = Ci.nsIAccessibleRole.ROLE_DEFINITION_LIST;
|
||||
|
@ -104,6 +105,7 @@ var gSimpleTraversalRoles =
|
|||
ROLE_RADIO_MENU_ITEM,
|
||||
ROLE_TOGGLE_BUTTON,
|
||||
ROLE_ENTRY,
|
||||
ROLE_KEY,
|
||||
ROLE_HEADER,
|
||||
ROLE_HEADING,
|
||||
// Used for traversing in to child OOP frames.
|
||||
|
|
|
@ -164,6 +164,12 @@ function forwardToChild(aMessage, aListener, aVCPosition) {
|
|||
function activateCurrent(aMessage) {
|
||||
Logger.debug('activateCurrent');
|
||||
function activateAccessible(aAccessible) {
|
||||
if (aMessage.json.activateIfKey &&
|
||||
aAccessible.role != Ci.nsIAccessibleRole.ROLE_KEY) {
|
||||
// Only activate keys, don't do anything on other objects.
|
||||
return;
|
||||
}
|
||||
|
||||
if (aAccessible.actionCount > 0) {
|
||||
aAccessible.doAction(0);
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче