mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 06:07:30 +09:00
Issue #2019 - Do not dispatch keypress event for non-printable keys.
This will prevent the keypress DOM event from firing on keypresses that do not produce printable keys (e.g. editing nav keys) in content. This should not affect any chrome events that are in use. Event dispatch can be re-enabled if necessary with the added pref.
This commit is contained in:
parent
2f0896ab31
commit
1392f5f223
6 changed files with 48 additions and 15 deletions
|
|
@ -183,6 +183,30 @@ public:
|
|||
return IsKeyEventOnPlugin(mMessage);
|
||||
}
|
||||
|
||||
bool IsInputtingText() const
|
||||
{
|
||||
// NOTE: On some keyboard layouts, some characters are put in with Control
|
||||
// or Alt keys, but at that time, widget unsets the modifier flag
|
||||
// from the eKeyPress event, so it does not count as a modifier in
|
||||
// this check.
|
||||
return mMessage == eKeyPress &&
|
||||
mCharCode &&
|
||||
!(mModifiers & (MODIFIER_ALT |
|
||||
MODIFIER_CONTROL |
|
||||
MODIFIER_META |
|
||||
MODIFIER_OS));
|
||||
}
|
||||
|
||||
bool IsInputtingLineBreak() const
|
||||
{
|
||||
return mMessage == eKeyPress &&
|
||||
mKeyNameIndex == KEY_NAME_INDEX_Enter &&
|
||||
!(mModifiers & (MODIFIER_ALT |
|
||||
MODIFIER_CONTROL |
|
||||
MODIFIER_META |
|
||||
MODIFIER_OS));
|
||||
}
|
||||
|
||||
virtual WidgetEvent* Duplicate() const override
|
||||
{
|
||||
MOZ_ASSERT(mClass == eKeyboardEventClass,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue