mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
5f18cf3bed
41 changed files with 234 additions and 485 deletions
|
|
@ -664,8 +664,7 @@ HTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
|||
return TypedText(NS_LITERAL_STRING("\t"), eTypedText);
|
||||
}
|
||||
case NS_VK_RETURN:
|
||||
if (nativeKeyEvent->IsControl() || nativeKeyEvent->IsAlt() ||
|
||||
nativeKeyEvent->IsMeta() || nativeKeyEvent->IsOS()) {
|
||||
if (!nativeKeyEvent->IsInputtingLineBreak()) {
|
||||
return NS_OK;
|
||||
}
|
||||
aKeyEvent->AsEvent()->PreventDefault(); // consumed
|
||||
|
|
@ -677,11 +676,7 @@ HTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
|||
return TypedText(EmptyString(), eTypedBreak);
|
||||
}
|
||||
|
||||
// NOTE: On some keyboard layout, some characters are inputted with Control
|
||||
// key or Alt key, but at that time, widget sets FALSE to these keys.
|
||||
if (!nativeKeyEvent->mCharCode || nativeKeyEvent->IsControl() ||
|
||||
nativeKeyEvent->IsAlt() || nativeKeyEvent->IsMeta() ||
|
||||
nativeKeyEvent->IsOS()) {
|
||||
if (!nativeKeyEvent->IsInputtingText()) {
|
||||
// we don't PreventDefault() here or keybindings like control-x won't work
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -397,20 +397,14 @@ TextEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
|
|||
return TypedText(NS_LITERAL_STRING("\t"), eTypedText);
|
||||
}
|
||||
case NS_VK_RETURN:
|
||||
if (IsSingleLineEditor() || nativeKeyEvent->IsControl() ||
|
||||
nativeKeyEvent->IsAlt() || nativeKeyEvent->IsMeta() ||
|
||||
nativeKeyEvent->IsOS()) {
|
||||
if (IsSingleLineEditor() || !nativeKeyEvent->IsInputtingLineBreak()) {
|
||||
return NS_OK;
|
||||
}
|
||||
aKeyEvent->AsEvent()->PreventDefault();
|
||||
return TypedText(EmptyString(), eTypedBreak);
|
||||
}
|
||||
|
||||
// NOTE: On some keyboard layout, some characters are inputted with Control
|
||||
// key or Alt key, but at that time, widget sets FALSE to these keys.
|
||||
if (!nativeKeyEvent->mCharCode || nativeKeyEvent->IsControl() ||
|
||||
nativeKeyEvent->IsAlt() || nativeKeyEvent->IsMeta() ||
|
||||
nativeKeyEvent->IsOS()) {
|
||||
if (!nativeKeyEvent->IsInputtingText()) {
|
||||
// we don't PreventDefault() here or keybindings like control-x won't work
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue