Skip to content

Commit

Permalink
The laptop keyboard layout has been completely redesigned in order to…
Browse files Browse the repository at this point in the history
… make it more intuitive and consistent.

Please see the What's New document for details.
Fixes #804.
  • Loading branch information
jcsteh committed Feb 4, 2013
2 parents a88f966 + 725dd9f commit b92a0a7
Show file tree
Hide file tree
Showing 9 changed files with 238 additions and 103 deletions.
2 changes: 1 addition & 1 deletion source/_UIAHandler.py
Expand Up @@ -102,7 +102,7 @@
UIA_SelectionItem_ElementRemovedFromSelectionEventId:"stateChange",
#UIA_MenuModeEndEventId:"menuModeEnd",
#UIA_Text_TextSelectionChangedEventId:"caret",
UIA_ToolTipOpenedEventId:"alert",
#UIA_ToolTipOpenedEventId:"alert",
#UIA_AsyncContentLoadedEventId:"documentLoadComplete",
#UIA_ToolTipClosedEventId:"hide",
}
Expand Down
3 changes: 3 additions & 0 deletions source/config/__init__.py
Expand Up @@ -182,6 +182,9 @@ def validateConfig(configObj,validator,validationResult=None,keyList=None):
alwaysIncludeShortCharacterDescriptionInCandidateName = boolean(default=True)
reportReadingStringChanges = boolean(default=True)
reportCompositionStringChanges = boolean(default=True)
[upgrade]
newLaptopKeyboardLayout = boolean(default=false)
"""
), list_values=False, encoding="UTF-8")
confspec.newlines = "\r\n"
Expand Down
3 changes: 3 additions & 0 deletions source/core.py
Expand Up @@ -38,6 +38,9 @@ def doStartupDialogs():
gui.messageBox(_("Your gesture map file contains errors.\n"
"More details about the errors can be found in the log file."),
_("gesture map File Error"), wx.OK|wx.ICON_EXCLAMATION)
if not config.conf["upgrade"]["newLaptopKeyboardLayout"]:
from gui import upgradeAlerts
upgradeAlerts.NewLaptopKeyboardLayout.run()

def restart():
"""Restarts NVDA by starting a new copy with -r."""
Expand Down
86 changes: 46 additions & 40 deletions source/globalCommands.py
Expand Up @@ -1048,7 +1048,8 @@ def script_touch_hoverUp(self,gesture):
"kb:NVDA+1": "toggleInputHelp",
"kb:NVDA+q": "quit",
"kb:NVDA+f2": "passNextKeyThrough",
"kb:NVDA+shift+s":"toggleCurrentAppSleepMode",
"kb(desktop):NVDA+shift+s":"toggleCurrentAppSleepMode",
"kb(laptop):NVDA+shift+z":"toggleCurrentAppSleepMode",

# System status
"kb:NVDA+f12": "dateTime",
Expand All @@ -1059,28 +1060,32 @@ def script_touch_hoverUp(self,gesture):
"kb:NVDA+tab": "reportCurrentFocus",
"kb:NVDA+t": "title",
"kb:NVDA+b": "speakForeground",
"kb:NVDA+end": "reportStatusLine",
"kb(desktop):NVDA+end": "reportStatusLine",
"kb(laptop):NVDA+shift+end": "reportStatusLine",

# System caret
"kb:NVDA+downArrow": "sayAll",
"kb:NVDA+upArrow": "reportCurrentLine",
"kb:NVDA+shift+upArrow": "reportCurrentSelection",
"kb(desktop):NVDA+downArrow": "sayAll",
"kb(laptop):NVDA+a": "sayAll",
"kb(desktop):NVDA+upArrow": "reportCurrentLine",
"kb(laptop):NVDA+l": "reportCurrentLine",
"kb(desktop):NVDA+shift+upArrow": "reportCurrentSelection",
"kb(laptop):NVDA+shift+s": "reportCurrentSelection",
"kb:NVDA+f": "reportFormatting",

# Object navigation
"kb:NVDA+numpad5": "navigatorObject_current",
"kb(laptop):NVDA+control+i": "navigatorObject_current",
"kb(laptop):NVDA+shift+o": "navigatorObject_current",
"kb:NVDA+numpad8": "navigatorObject_parent",
"kb(laptop):NVDA+shift+i": "navigatorObject_parent",
"kb(laptop):NVDA+shift+upArrow": "navigatorObject_parent",
"ts(object):flickup":"navigatorObject_parent",
"kb:NVDA+numpad4": "navigatorObject_previous",
"kb(laptop):NVDA+control+j": "navigatorObject_previous",
"kb(laptop):NVDA+shift+leftArrow": "navigatorObject_previous",
"ts(object):flickleft":"navigatorObject_previous",
"kb:NVDA+numpad6": "navigatorObject_next",
"kb(laptop):NVDA+control+l": "navigatorObject_next",
"kb(laptop):NVDA+shift+rightArrow": "navigatorObject_next",
"ts(object):flickright":"navigatorObject_next",
"kb:NVDA+numpad2": "navigatorObject_firstChild",
"kb(laptop):NVDA+shift+,": "navigatorObject_firstChild",
"kb(laptop):NVDA+shift+downArrow": "navigatorObject_firstChild",
"ts(object):flickdown":"navigatorObject_firstChild",
"kb:NVDA+numpadMinus": "navigatorObject_toFocus",
"kb(laptop):NVDA+backspace": "navigatorObject_toFocus",
Expand All @@ -1101,40 +1106,40 @@ def script_touch_hoverUp(self,gesture):
"ts:hoverUp":"touch_hoverUp",
# Review cursor
"kb:shift+numpad7": "review_top",
"kb(laptop):NVDA+7": "review_top",
"kb(laptop):NVDA+control+home": "review_top",
"kb:numpad7": "review_previousLine",
"ts(text):flickUp":"review_previousLine",
"kb(laptop):NVDA+u": "review_previousLine",
"kb(laptop):NVDA+upArrow": "review_previousLine",
"kb:numpad8": "review_currentLine",
"kb(laptop):NVDA+i": "review_currentLine",
"kb(laptop):NVDA+shift+.": "review_currentLine",
"kb:numpad9": "review_nextLine",
"kb(laptop):NVDA+o": "review_nextLine",
"kb(laptop):NVDA+downArrow": "review_nextLine",
"ts(text):flickDown":"review_nextLine",
"kb:shift+numpad9": "review_bottom",
"kb(laptop):NVDA+9": "review_bottom",
"kb(laptop):NVDA+control+end": "review_bottom",
"kb:numpad4": "review_previousWord",
"kb(laptop):NVDA+j": "review_previousWord",
"kb(laptop):NVDA+control+leftArrow": "review_previousWord",
"ts(text):2finger_flickLeft":"review_previousWord",
"kb:numpad5": "review_currentWord",
"kb(laptop):NVDA+k": "review_currentWord",
"kb(laptop):NVDA+control+.": "review_currentWord",
"ts(text):hoverUp":"review_currentWord",
"kb:numpad6": "review_nextWord",
"kb(laptop):NVDA+l": "review_nextWord",
"kb(laptop):NVDA+control+rightArrow": "review_nextWord",
"ts(text):2finger_flickRight":"review_nextWord",
"kb:shift+numpad1": "review_startOfLine",
"kb(laptop):NVDA+shift+u": "review_startOfLine",
"kb(laptop):NVDA+home": "review_startOfLine",
"kb:numpad1": "review_previousCharacter",
"kb(laptop):NVDA+m": "review_previousCharacter",
"kb(laptop):NVDA+leftArrow": "review_previousCharacter",
"ts(text):flickLeft":"review_previousCharacter",
"kb:numpad2": "review_currentCharacter",
"kb(laptop):NVDA+,": "review_currentCharacter",
"kb(laptop):NVDA+.": "review_currentCharacter",
"kb:numpad3": "review_nextCharacter",
"kb(laptop):NVDA+.": "review_nextCharacter",
"kb(laptop):NVDA+rightArrow": "review_nextCharacter",
"ts(text):flickRight":"review_nextCharacter",
"kb:shift+numpad3": "review_endOfLine",
"kb(laptop):NVDA+shift+o": "review_endOfLine",
"kb(laptop):NVDA+end": "review_endOfLine",
"kb:numpadPlus": "review_sayAll",
"kb(laptop):NVDA+shift+downArrow": "review_sayAll",
"kb(laptop):NVDA+shift+a": "review_sayAll",
"ts(text):3finger_flickDown":"review_sayAll",
"kb:NVDA+f9": "review_markStartForCopy",
"kb:NVDA+f10": "review_copy",
Expand All @@ -1149,17 +1154,17 @@ def script_touch_hoverUp(self,gesture):

# Mouse
"kb:numpadDivide": "leftMouseClick",
"kb(laptop):NVDA+leftArrow": "leftMouseClick",
"kb(laptop):NVDA+[": "leftMouseClick",
"kb:shift+numpadDivide": "toggleLeftMouseButton",
"kb(laptop):NVDA+shift+leftArrow": "toggleLeftMouseButton",
"kb(laptop):NVDA+control+[": "toggleLeftMouseButton",
"kb:numpadMultiply": "rightMouseClick",
"kb(laptop):NVDA+rightArrow": "rightMouseClick",
"kb(laptop):NVDA+]": "rightMouseClick",
"kb:shift+numpadMultiply": "toggleRightMouseButton",
"kb(laptop):NVDA+shift+rightArrow": "toggleRightMouseButton",
"kb(laptop):NVDA+control+]": "toggleRightMouseButton",
"kb:NVDA+numpadDivide": "moveMouseToNavigatorObject",
"kb(laptop):NVDA+shift+f9": "moveMouseToNavigatorObject",
"kb(laptop):NVDA+shift+m": "moveMouseToNavigatorObject",
"kb:NVDA+numpadMultiply": "moveNavigatorObjectToMouse",
"kb(laptop):NVDA+shift+f10": "moveNavigatorObjectToMouse",
"kb(laptop):NVDA+shift+n": "moveNavigatorObjectToMouse",

# Tree interceptors
"kb:NVDA+space": "toggleVirtualBufferPassThrough",
Expand All @@ -1185,21 +1190,22 @@ def script_touch_hoverUp(self,gesture):
"kb:NVDA+4": "toggleSpeakCommandKeys",
"kb:NVDA+p": "cycleSpeechSymbolLevel",
"kb:NVDA+s": "speechMode",
"kb(desktop):NVDA+m": "toggleMouseTracking",
"kb(laptop):NVDA+shift+m": "toggleMouseTracking",
"kb(desktop):NVDA+u": "toggleProgressBarOutput",
"kb(laptop):NVDA+control+f2": "toggleProgressBarOutput",
"kb:NVDA+m": "toggleMouseTracking",
"kb:NVDA+u": "toggleProgressBarOutput",
"kb:NVDA+5": "toggleReportDynamicContentChanges",
"kb:NVDA+6": "toggleCaretMovesReviewCursor",
"kb(desktop):NVDA+7": "toggleFocusMovesNavigatorObject",
"kb(laptop):NVDA+control+7": "toggleFocusMovesNavigatorObject",
"kb:NVDA+7": "toggleFocusMovesNavigatorObject",
"kb:NVDA+control+t": "braille_toggleTether",

# Synth settings ring
"kb:NVDA+control+leftArrow": "previousSynthSetting",
"kb:NVDA+control+rightArrow": "nextSynthSetting",
"kb:NVDA+control+upArrow": "increaseSynthSetting",
"kb:NVDA+control+downArrow": "decreaseSynthSetting",
"kb(desktop):NVDA+control+leftArrow": "previousSynthSetting",
"kb(laptop):NVDA+shift+control+leftArrow": "previousSynthSetting",
"kb(desktop):NVDA+control+rightArrow": "nextSynthSetting",
"kb(laptop):NVDA+shift+control+rightArrow": "nextSynthSetting",
"kb(desktop):NVDA+control+upArrow": "increaseSynthSetting",
"kb(laptop):NVDA+shift+control+upArrow": "increaseSynthSetting",
"kb(desktop):NVDA+control+downArrow": "decreaseSynthSetting",
"kb(laptop):NVDA+control+shift+downArrow": "decreaseSynthSetting",

# Braille keyboard
"bk:dots" : "braille_dots",
Expand Down
64 changes: 64 additions & 0 deletions source/gui/upgradeAlerts.py
@@ -0,0 +1,64 @@
#upgradeAlerts.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2013 NV Access Limited
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

"""Dialogs displayed when NVDA starts containing important information about changes to NVDA.
"""

import os
import wx
import gui
import config

class NewLaptopKeyboardLayout(wx.Dialog):
MESSAGE = _(
# Translators: Information about NVDA's new laptop keyboard layout.
"In NVDA 2013.1, the laptop keyboard layout has been completely redesigned in order to make it more intuitive and consistent.\n"
"If you use the laptop layout, please see the What's New document for more information."
)

def __init__(self, parent):
# Translators: The title of a dialog providing information about NVDA's new laptop keyboard layout.
super(NewLaptopKeyboardLayout, self).__init__(parent, title=_("New Laptop Keyboard layout"))
mainSizer = wx.BoxSizer(wx.VERTICAL)
item = wx.StaticText(self, label=self.MESSAGE)
mainSizer.Add(item, border=20, flag=wx.LEFT | wx.RIGHT | wx.TOP)
# Translators: The label of a button in the New Laptop Keyboard Layout dialog
# to open the What's New document.
whatsNewButton = wx.Button(self, label=_("Read What's New"))
whatsNewButton.Bind(wx.EVT_BUTTON, self.onWhatsNew)
mainSizer.Add(whatsNewButton)

mainSizer.Add(self.CreateButtonSizer(wx.OK),flag=wx.TOP|wx.BOTTOM|wx.ALIGN_CENTER_HORIZONTAL,border=20)
self.Bind(wx.EVT_BUTTON, lambda evt: self.Close(), id=wx.ID_OK)

self.Bind(wx.EVT_CLOSE, self.onClose)

whatsNewButton.SetFocus()
self.Sizer = mainSizer
mainSizer.Fit(self)

def onClose(self, evt):
config.conf["upgrade"]["newLaptopKeyboardLayout"] = True
try:
config.save()
except:
pass
self.EndModal(0)

def onWhatsNew(self, evt):
os.startfile(gui.getDocFilePath("changes.html"))
self.Close()

@classmethod
def run(cls):
"""Prepare and display an instance of this dialog.
This does not require the dialog to be instantiated.
"""
gui.mainFrame.prePopup()
d = cls(gui.mainFrame)
d.ShowModal()
d.Destroy()
gui.mainFrame.postPopup()
5 changes: 5 additions & 0 deletions source/locale/de/gestures.ini
@@ -0,0 +1,5 @@
[globalCommands.GlobalCommands]
leftMouseClick = kb(laptop):NVDA+ü
toggleLeftMouseButton = kb(laptop):NVDA+control+ü
rightMouseClick = kb(laptop):NVDA+plus
toggleRightMouseButton = kb(laptop):NVDA+control+plus

0 comments on commit b92a0a7

Please sign in to comment.