AskPassphraseDialog, CAPS LOCK and non-US keyboards #1855

issue xanatos opened this issue on September 22, 2012
  1. xanatos commented at 10:29 AM on September 22, 2012: none

    On non-us keyboards you can obtain lower case characters even pressing the SHIFT. For example here in Italy, where US persons have the '[' key, if you press the shift instead of obtaining the '{' you obtain the 'é', the same for the ';' key that shifted instead of giving the ':' gives 'ç', both lower case letters, so the

    if ((fShift && psz->isLower()) || (!fShift && psz->isUpper())) {

    test (around line 229 of askpassphrasedialog.cpp) gives the "wrong" result. (the problem of the test is that it thinks that without CAPS LOCK a shift+something should be uppercase if it's a letter)

    A better idea would be to do something like:

    if ((fShift && *psz >= 'a' && *psz <= 'z') || (!fShift && *psz >= 'A' && *psz <= 'Z')) {

    this will probably break with the turkish i-without-dot (http://en.wikipedia.org/wiki/Dotted_and_dotless_I), but at least the 26 standard letters will be catched

  2. laanwj commented at 10:13 AM on September 25, 2012: member

    Yeah, it's a pretty crappy heuristic, one that really only works for US/English keyboard layouts where "shift" means "uppercase". I would have no idea what it does in Hebrew, or Chinese, for example.

    Probably, your fix is slightly better.

    If only Qt had a reliable way of detecting the capslock state...

  3. laanwj referenced this in commit 09dfa86baf on Mar 29, 2013
  4. laanwj closed this on Nov 7, 2013

  5. laudney referenced this in commit 332324ac86 on Mar 19, 2014
  6. KolbyML referenced this in commit 3cd52771f2 on Dec 5, 2020
  7. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me