question about some braille tricks


Илья Пащук
 

hello.


I have the following questions:

1. may I programaticly, from the addon, change braille input and output table?

this preferably should be done only for a particular nvda object (text editor), and should never be reflected in any persistent configuration.

2. may I programaticly inflate a custom braille table to use it in the step 1?

now I'm replacing files in louis\tables to make use of custom tables. is it the only working way how custom tables may be used?

as I know liblouis allows this.

3. may I get information about current input language (current keyboard layout) from the nvda?


thank you.


Noelia Ruiz
 

Hello:

For question 2, see issue about custom tables at

https://github.com/nvaccess/nvda/issues/3304

For 3, about keyboard, see Abdel's add-on at:

https://github.com/abdel792/sayCurrentKeyboardLanguage

For 1, to switch braille tables in objects, based on example 6 of
developer guide I have writen some code which may work for you with
some customizations that you can add. This is just an approach; other
members of this list may provide different solutions:

a. You can create a dedicated profile to be activated in particular
objs, using installTasks, onInstall method:

installTasks.py

import config


def onInstall():
config.conf.createProfile("enhancedBraille")
config.conf.manualActivateProfile("enhancedBraille")
config.conf["braille"...][ # Here you can specify inputTable and
translationTable.

b2. Use this in your plugin

import appModuleHandler

from NVDAObjects.IAccessible import IAccessible
import controlTypes
import config
class AppModule(appModuleHandler.AppModule):

def chooseNVDAObjectOverlayClasses(self, obj, clsList):
if obj.windowClassName == "Edit" and obj.role ==
controlTypes.Role.EDITABLETEXT:
clsList.insert(0, EnhancedEditField)

class EnhancedEditField(IAccessible):


def event_gainFocus(self):
config.conf.manualActivateProfile("enhancedBraille")
self._handleProfileSwitch()

def event_loseFocus(self):
profile = config.conf.getProfile("enhancedBraille")
if profile.manual:
del config.conf.profiles[-1]
config.conf._handleProfileSwitch()

Here's the developer guide:

https://www.nvaccess.org/files/nvda/documentation/developerGuide.html

Hope this helps

2022-01-10 16:54 GMT+01:00, Илья Пащук <ilusha.paschuk@gmail.com>:

hello.


I have the following questions:

1. may I programaticly, from the addon, change braille input and output
table?

this preferably should be done only for a particular nvda object (text
editor), and should never be reflected in any persistent configuration.

2. may I programaticly inflate a custom braille table to use it in the
step 1?

now I'm replacing files in louis\tables to make use of custom tables. is
it the only working way how custom tables may be used?

as I know liblouis allows this.

3. may I get information about current input language (current keyboard
layout) from the nvda?


thank you.