Results 1 to 3 of 3

Thread: list of available characters from keyboard

  1. #1
    Join Date
    Nov 2007
    Posts
    55
    Thanks
    1
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default list of available characters from keyboard

    I have written a program calculating a quality index for a password. For this, I need to know how many characters are available in each group of characters (lowercase letter, uppercase letter, arabic numerals, others (punctuation, symbols, spaces)).

    How can I achieve this?

    QLocale::language() and QLocale::country() are giving the ground information.
    Now, if I do not want to precompute for each language the number of characters belonging to each group as defined above, I should be able to "scan" the keyboard.
    To do that, I would need to know how the physical keys are mapped into software event through the keyboard driver. Is that information available? and if yes, how to access it?

    May be somebody has another idea how to achieve the task!

    Thank you for your valuable time
    Alain

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: list of available characters from keyboard

    There is little correlation between the keys on the keyboard and the characters than can be composed using the keyboard. My US English keyboard is quite capable of generating all manner of non-English characters just by telling the OS it to treat it differently.

    If you want to check that the characters in a given password meet certain strength criteria then just check each character in turn using QChar::isLetter(), isDigit(), isPunct() etc. Every Unicode code point is already characterised for you. If you really want to know how many code points in the Unicode basic Multilingual plane fall into each category then you could simply interate all 65000 or so code points.

  3. #3
    Join Date
    Nov 2007
    Posts
    55
    Thanks
    1
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: list of available characters from keyboard

    Hello Chris,

    I check each character of the password as you stipulate and build up the sum in each character group.
    But I need also to know how many characters are available in each group at all to build up weights. For example it makes no sense to ask for uppercase letters in language which have no of them.

    I am aware that you can reach every character defined in unicode by entering the unicode code of the character , but users seldom do that and restrict their use to those characters available with their keyboard. That's why I am not interested in knowing how many letters digits, punctuation signs and so on are available in unicode but restricted to those accessible directly through the keyboard.

Similar Threads

  1. Number of elements in a list of list
    By giorgik in forum General Programming
    Replies: 5
    Last Post: 18th July 2013, 08:36
  2. Replies: 1
    Last Post: 14th November 2012, 21:00
  3. Replies: 4
    Last Post: 14th June 2012, 23:33
  4. Replies: 1
    Last Post: 23rd April 2011, 17:33
  5. List View with sections for alphabetialy sorted list
    By woodtluk in forum Qt Programming
    Replies: 4
    Last Post: 12th October 2010, 11:50

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.