BMenu: Accept any alphanumeric ASCII character on the first trigger pass.
Since we use sentence-cased menus, there is probably only one capital letter in the line, so looking for only capitals won't be very useful. Instead, accept any ASCII character (< 255) which is alphanumeric, as these are more likely to be command-able in any given keymap. (IsAlNum returns true for accented Latin characters also, which may be un-command-able if they require dead keys to type.)
This commit is contained in:
@@ -2879,11 +2879,11 @@ BMenu::_ChooseTrigger(const char* title, int32& index, uint32& trigger,
|
|||||||
uint32 c;
|
uint32 c;
|
||||||
const char* nextCharacter, *character;
|
const char* nextCharacter, *character;
|
||||||
|
|
||||||
// two runs: first we look out for uppercase letters
|
// two runs: first we look out for alphanumeric ASCII characters
|
||||||
nextCharacter = title;
|
nextCharacter = title;
|
||||||
character = nextCharacter;
|
character = nextCharacter;
|
||||||
while ((c = BUnicodeChar::FromUTF8(&nextCharacter)) != 0) {
|
while ((c = BUnicodeChar::FromUTF8(&nextCharacter)) != 0) {
|
||||||
if (!BUnicodeChar::IsUpper(c) || triggers.HasTrigger(c)) {
|
if (!(c < 255 && BUnicodeChar::IsAlNum(c)) || triggers.HasTrigger(c)) {
|
||||||
character = nextCharacter;
|
character = nextCharacter;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2892,7 +2892,7 @@ BMenu::_ChooseTrigger(const char* title, int32& index, uint32& trigger,
|
|||||||
return triggers.AddTrigger(c);
|
return triggers.AddTrigger(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// then, if we still haven't found anything, we accept them all
|
// then, if we still haven't found something, we accept anything
|
||||||
nextCharacter = title;
|
nextCharacter = title;
|
||||||
character = nextCharacter;
|
character = nextCharacter;
|
||||||
while ((c = BUnicodeChar::FromUTF8(&nextCharacter)) != 0) {
|
while ((c = BUnicodeChar::FromUTF8(&nextCharacter)) != 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user