nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.1k stars 634 forks source link

Report alt codes for characters with "report current character" command (numpad 2 or NVDA+dot three times quickly) #16835

Closed Qchristensen closed 3 months ago

Qchristensen commented 3 months ago

Is your feature request related to a problem? Please describe.

If you press numpad 2 or NVDA+dot three times quickly, NVDA reports the decimal and hex values for a symbol. For instance, for the pound symbol, £, NVDA reads 163, 0xA3. It would be useful to report the alt code as well. For the pound symbol £, that is alt 1 5 6. That is, you can hold down the alt key, press the numbers 1 5 6 and it will insert a pound symbol.

Describe the solution you'd like

NVDA should read the decimal, hex and alt codes for characters. For £ this would be "163, 0xA3, Alt 1 5 6".

Describe alternatives you've considered

It is possible to look these numbers up online at sites such as https://www.alt-codes.net/ or using Windows character map, but since we already have a function which essentially does this, it would be useful to add the functionality.

Additional context

(Requested during ATUG presentation)

josephsl commented 3 months ago

Hi, this will not work on keyboards without numpads such as ThinkPad laptops (I use a ThinkPad without dedicated or emulated Numpad). Besides, the alt code listed does not match hex (ASCII/Unicode) representation of a character, which could confuse people. As an alternative, one can open emoji panel, select symbols, and look for the correct symbol, although entering alt codes is faster. Thanks.

josephsl commented 3 months ago

Hi,

Turns out this may not be practical: based on a quick reading in Wikipedia and looking up history of keyboard code pages, Alt code combinations differ based on code pages. The Alt+156 combination for pound sign (£) assumes use of CP437, an old code page used in MS-DOS and kept for compatibility reasons in Windows. Windows itself uses newer code pages, and these such as 1252 may assign different Alt code combinations for the same character.

In addition to emoji panel workaround, another alternative is switching keyboard layouts on the fly (Windows+Space keys). However, we run into Unicode character entry issue where using Alt codes is more efficient unless macros are added to enter characters on the fly. As I noted above, Alt code entry requires a keyboard with actual (or emulated) Numpad, something that may not exist on all keyboards (physical or virtual).

Thanks.

Qchristensen commented 3 months ago

Interestingly I've known alt 1 5 6 for pound £ for years and I couldn't tell you where I learnt it. But looking up the symbol in the symbol viewer in Word, it also lists the alt code - and it gives alt 0 1 6 3 - which is slightly longer, but is the decimal unicode value we already provide with Numpad2 / NVDA+dot three times quickly. So between that, and your finding that I was using an old reference kept in for compatibility (with dinosaurs like me), that probably answers that. Thanks!