KItemListKeyboardSearchManager and QApplication::keyboardInputInterval()

Frank Reininghaus frank78ac at googlemail.com
Tue Mar 27 19:15:28 BST 2012


Hi everyone,

in Dolphin, when you press a letter on the keyboard (like "a"),  the
first file with a name starting with that letter will be the new
current item. If you then press "b", the first file whose name starts
with "ab" will be the new current item, and so on. Restoring this
feature after Dolphin's adoption of a new view engine in KDE 4.8 was a
nice work by Tirtha. Even though it's not implemented quite in the
same way as QAbstractItemView's search functionality, it behaves
mostly the same way.

Recently, there was a discussion in the Dolphin forum about this
feature: http://forum.kde.org/viewtopic.php?f=224&t=98758
A user thought that it's not possible to search for more than just the
first letter of a file name: pressing "a" and then "b" lets Dolphin
search first for a file "a*" and then for a file "b*" for him. Another
user pointed out that he has to type faster.

It seems that the max. interval between two key presses which are
recognised as belonging to one word is really quite short. This
interval is
QApplication::keyboardInputInterval(). I've just had a look at the
documentation of this function: "This property holds the time limit in
milliseconds that distinguishes a key press from two consecutive key
presses.". In other words, if a key is held longer than that, Qt will
recognise this as repeated key presses.

I think that it does actually not make much sense to use the same
interval for our "keyboard search" use case, even if QAbstractItemView
does the same. In order to remove this inconsistency and to make
keyboard search more comfortable for users who can't type extremely
fast, we might want to change this. I see two possible solutions at
the moment:

1. Replace the use of QApplication::keyboardInputInterval() in
KItemListKeyboardSearchManager by some longer interval.

2. Maybe better: don't consider a keyboard search as finished when a
hardcoded time interval has passed, but when the user presses a
non-letter key to change the current item or when a mouse button is
pressed.

Any thoughts about this?

Best regards,
Frank




More information about the kfm-devel mailing list