mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 19:27:56 +01:00
Quotation mark (#30481)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Add Quotation mark Add local quotation based on ~~VK_OEM_7(0xDE)~~ VK_OEM_COMMA(0xBC) key. Not all quotes have been added, only `‟ „ ” « » ‚ , ‘ ’ › ‹ '「 」 《 》 『 』〈 〉″ ‴ ⁗` Why not added : - ` ⹂ ⌜ ⌝ ❛ ❜ ❝ ❞ 🙶 🙷 🙸 ' 「 」 ` its redundant and would make too much and not readable. - ` ﹁ ﹂ ﹃ ﹄ ` I did not put them because there use for horizontal text <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: https://github.com/microsoft/PowerToys/issues/29371 https://github.com/microsoft/PowerToys/issues/24832 - [ ] **Communication:** I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end user facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places (None) - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> This PR is currently a draft, I still need to know if adding language-related keyboard management is a good idea or specifying the use of a gobal key to make it easier to manage all the keyboards in one. Some languages can use different keyboards, I think this would become problematic if the keyboard does not match the key used by default. However, using a universal key can also pose an issue to finding the key. that remains to be discussed <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
This commit is contained in:
committed by
GitHub
parent
503bcbdf2d
commit
9dcddfd4b8
@@ -224,7 +224,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_X => new[] { "ẋ", "×" },
|
||||
LetterKey.VK_Y => new[] { "ẏ", "ꝡ" },
|
||||
LetterKey.VK_Z => new[] { "ʒ", "ǯ", "ℤ" },
|
||||
LetterKey.VK_COMMA => new[] { "∙", "₋", "⁻", "–", "√" }, // – is in VK_MINUS for other languages, but not VK_COMMA, so we add it here.
|
||||
LetterKey.VK_COMMA => new[] { "∙", "₋", "⁻", "–", "√", "‟", "《", "》", "‛", "〈", "〉", "″", "‴", "⁗" }, // – is in VK_MINUS for other languages, but not VK_COMMA, so we add it here.
|
||||
LetterKey.VK_PERIOD => new[] { "…", "⁝", "\u0300", "\u0301", "\u0302", "\u0303", "\u0304", "\u0308", "\u030B", "\u030C" },
|
||||
LetterKey.VK_MINUS => new[] { "~", "‐", "‑", "‒", "—", "―", "⁓", "−", "⸺", "⸻", "∓" },
|
||||
LetterKey.VK_SLASH_ => new[] { "÷", "√" },
|
||||
@@ -302,6 +302,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_E => new[] { "€" },
|
||||
LetterKey.VK_S => new[] { "š" },
|
||||
LetterKey.VK_Z => new[] { "ž" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "»", "«" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -317,6 +318,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_U => new[] { "ü" },
|
||||
LetterKey.VK_Z => new[] { "ž" },
|
||||
LetterKey.VK_S => new[] { "š" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "«", "»" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -344,6 +346,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_A => new[] { "ä", "å" },
|
||||
LetterKey.VK_E => new[] { "€" },
|
||||
LetterKey.VK_O => new[] { "ö" },
|
||||
LetterKey.VK_COMMA => new[] { "”", "’", "»" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -360,6 +363,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_O => new[] { "ô", "ö", "ó", "ò", "õ", "œ" },
|
||||
LetterKey.VK_U => new[] { "û", "ù", "ü", "ú" },
|
||||
LetterKey.VK_Y => new[] { "ÿ", "ý" },
|
||||
LetterKey.VK_COMMA => new[] { "«", "»", "‹", "›", "“", "”", "‘", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -376,6 +380,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_U => new[] { "ú" },
|
||||
LetterKey.VK_Y => new[] { "ý" },
|
||||
LetterKey.VK_T => new[] { "þ" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -393,7 +398,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_N => new[] { "ñ" },
|
||||
LetterKey.VK_O => new[] { "ó" },
|
||||
LetterKey.VK_U => new[] { "ú", "ü" },
|
||||
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!" },
|
||||
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!", "«", "»", "“", "”", "‘", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -411,7 +416,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_O => new[] { "ò", "ó" },
|
||||
LetterKey.VK_U => new[] { "ù", "ú", "ü" },
|
||||
LetterKey.VK_L => new[] { "·" },
|
||||
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!" },
|
||||
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!", "«", "»", "“", "”", "‘", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -427,6 +432,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_O => new[] { "ō" },
|
||||
LetterKey.VK_S => new[] { "$" },
|
||||
LetterKey.VK_U => new[] { "ū" },
|
||||
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -443,6 +449,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_N => new[] { "ñ" },
|
||||
LetterKey.VK_O => new[] { "ó", "ö", "ô" },
|
||||
LetterKey.VK_U => new[] { "ú", "ü", "û" },
|
||||
LetterKey.VK_COMMA => new[] { "“", "„", "”", "‘", ",", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -469,6 +476,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_V => new[] { "ü", "ǖ", "ǘ", "ǚ", "ǜ" },
|
||||
LetterKey.VK_Y => new[] { "¥" },
|
||||
LetterKey.VK_Z => new[] { "ẑ" },
|
||||
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’", "「", "」", "『", "』" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -505,6 +513,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_S => new[] { "ş" },
|
||||
LetterKey.VK_T => new[] { "₺" },
|
||||
LetterKey.VK_U => new[] { "ü", "û" },
|
||||
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’", "«", "»", "‹", "›" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -522,6 +531,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_O => new[] { "ó" },
|
||||
LetterKey.VK_S => new[] { "ś" },
|
||||
LetterKey.VK_Z => new[] { "ż", "ź" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "”", "‘", "’", "»", "«" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -539,7 +549,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_P => new[] { "π" },
|
||||
LetterKey.VK_S => new[] { "$" },
|
||||
LetterKey.VK_U => new[] { "ú" },
|
||||
LetterKey.VK_COMMA => new[] { "≤", "≥", "≠", "≈", "≙", "±", "₊", "⁺" },
|
||||
LetterKey.VK_COMMA => new[] { "≤", "≥", "≠", "≈", "≙", "±", "₊", "⁺", "“", "”", "‘", "’", "«", "»" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -594,6 +604,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_U => new[] { "ú" },
|
||||
LetterKey.VK_Y => new[] { "ý" },
|
||||
LetterKey.VK_Z => new[] { "ž" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘", "»", "«", "›", "‹" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -608,6 +619,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_I => new[] { "í" },
|
||||
LetterKey.VK_O => new[] { "ó" },
|
||||
LetterKey.VK_U => new[] { "ú" },
|
||||
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -623,6 +635,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_O => new[] { "ò" },
|
||||
LetterKey.VK_P => new[] { "£" },
|
||||
LetterKey.VK_U => new[] { "ù" },
|
||||
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -645,6 +658,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_U => new[] { "ů", "ú" },
|
||||
LetterKey.VK_Y => new[] { "ý" },
|
||||
LetterKey.VK_Z => new[] { "ž" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘", "»", "«", "›", "‹" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -659,6 +673,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_O => new[] { "ö" },
|
||||
LetterKey.VK_S => new[] { "ß" },
|
||||
LetterKey.VK_U => new[] { "ü" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘", "»", "«", "›", "‹" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -689,6 +704,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_X => new string[] { "ξ" },
|
||||
LetterKey.VK_Y => new string[] { "υ" },
|
||||
LetterKey.VK_Z => new string[] { "ζ" },
|
||||
LetterKey.VK_COMMA => new[] { "“", "”", "«", "»", },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -710,7 +726,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_U => new[] { "וֹ", "וּ", "װ", "\u05b9" },
|
||||
LetterKey.VK_X => new[] { "\u05b6", "\u05b1" },
|
||||
LetterKey.VK_Y => new[] { "ױ" },
|
||||
LetterKey.VK_COMMA => new[] { "”", "’", "״", "׳" },
|
||||
LetterKey.VK_COMMA => new[] { "”", "’", "'", "״", "׳" },
|
||||
LetterKey.VK_PERIOD => new[] { "\u05ab", "\u05bd", "\u05bf" },
|
||||
LetterKey.VK_MINUS => new[] { "–", "־" },
|
||||
_ => Array.Empty<string>(),
|
||||
@@ -727,6 +743,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_I => new[] { "í" },
|
||||
LetterKey.VK_O => new[] { "ó", "ő", "ö" },
|
||||
LetterKey.VK_U => new[] { "ú", "ű", "ü" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "”", "»", "«" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -740,6 +757,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_I => new[] { "î" },
|
||||
LetterKey.VK_S => new[] { "ș" },
|
||||
LetterKey.VK_T => new[] { "ț" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "”", "«", "»" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -754,6 +772,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_I => new[] { "ì", "í" },
|
||||
LetterKey.VK_O => new[] { "ò", "ó" },
|
||||
LetterKey.VK_U => new[] { "ù", "ú" },
|
||||
LetterKey.VK_COMMA => new[] { "«", "»", "“", "”", "‘", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -772,6 +791,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_R => new[] { "ř" },
|
||||
LetterKey.VK_S => new[] { "ş" },
|
||||
LetterKey.VK_U => new[] { "û", "ü" },
|
||||
LetterKey.VK_COMMA => new[] { "«", "»", "“", "”" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -789,6 +809,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_U => new[] { "û", "ü", "ù", "ú" },
|
||||
LetterKey.VK_Y => new[] { "ŷ", "ÿ", "ỳ", "ý" },
|
||||
LetterKey.VK_W => new[] { "ŵ", "ẅ", "ẁ", "ẃ" },
|
||||
LetterKey.VK_COMMA => new[] { "‘", "’", "“", "“" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -801,6 +822,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_A => new[] { "å", "ä" },
|
||||
LetterKey.VK_E => new[] { "é" },
|
||||
LetterKey.VK_O => new[] { "ö" },
|
||||
LetterKey.VK_COMMA => new[] { "”", "’", "»", "«" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -814,6 +836,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_D => new[] { "đ" },
|
||||
LetterKey.VK_S => new[] { "š" },
|
||||
LetterKey.VK_Z => new[] { "ž" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "’", "»", "«", "›", "‹" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -838,6 +861,7 @@ namespace PowerAccent.Core
|
||||
{
|
||||
LetterKey.VK_E => new[] { "ѐ" },
|
||||
LetterKey.VK_I => new[] { "ѝ" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "’", "‘" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -869,6 +893,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_E => new[] { "€", "é" },
|
||||
LetterKey.VK_O => new[] { "ø" },
|
||||
LetterKey.VK_S => new[] { "$" },
|
||||
LetterKey.VK_COMMA => new[] { "«", "»", ",", "‘", "’", "„", "“" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -881,6 +906,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_A => new[] { "å", "æ" },
|
||||
LetterKey.VK_E => new[] { "€" },
|
||||
LetterKey.VK_O => new[] { "ø" },
|
||||
LetterKey.VK_COMMA => new[] { "»", "«", "“", "”", "›", "‹", "‘", "’" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -897,6 +923,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_S => new[] { "š" },
|
||||
LetterKey.VK_U => new[] { "ų", "ū" },
|
||||
LetterKey.VK_Z => new[] { "ž" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
@@ -910,6 +937,7 @@ namespace PowerAccent.Core
|
||||
LetterKey.VK_E => new[] { "€" },
|
||||
LetterKey.VK_S => new[] { "š" },
|
||||
LetterKey.VK_Z => new[] { "ž" },
|
||||
LetterKey.VK_COMMA => new[] { "„", "“", "»", "«" },
|
||||
_ => Array.Empty<string>(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public partial class PowerAccent : IDisposable
|
||||
|
||||
// Keys that show a description (like dashes) when ShowCharacterInfoSetting is 1
|
||||
private readonly LetterKey[] _letterKeysShowingDescription = new LetterKey[] { LetterKey.VK_O };
|
||||
private const double ScreenMinPadding = 150;
|
||||
|
||||
private bool _visible;
|
||||
private string[] _characters = Array.Empty<string>();
|
||||
@@ -332,6 +333,11 @@ public partial class PowerAccent : IDisposable
|
||||
return Calculation.GetRawCoordinatesFromPosition(position, screen, window);
|
||||
}
|
||||
|
||||
public double GetDisplayMaxWidth()
|
||||
{
|
||||
return WindowsFunctions.GetActiveDisplay().Size.Width - ScreenMinPadding;
|
||||
}
|
||||
|
||||
public Position GetToolbarPosition()
|
||||
{
|
||||
return _settingService.Position;
|
||||
|
||||
@@ -59,6 +59,7 @@ public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChange
|
||||
_selectedIndex = index;
|
||||
characters.SelectedIndex = _selectedIndex;
|
||||
characterName.Text = _powerAccent.CharacterDescriptions[_selectedIndex];
|
||||
characters.ScrollIntoView(character);
|
||||
}
|
||||
|
||||
private void PowerAccent_OnChangeDisplay(bool isActive, string[] chars)
|
||||
@@ -73,6 +74,7 @@ public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChange
|
||||
characters.ItemsSource = chars;
|
||||
characters.SelectedIndex = _selectedIndex;
|
||||
this.UpdateLayout(); // Required for filling the actual width/height before positioning.
|
||||
SetWindowsSize();
|
||||
SetWindowPosition();
|
||||
Show();
|
||||
Microsoft.PowerToys.Telemetry.PowerToysTelemetry.Log.WriteEvent(new PowerAccent.Core.Telemetry.PowerAccentShowAccentMenuEvent());
|
||||
@@ -96,6 +98,11 @@ public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChange
|
||||
this.Top = position.Y;
|
||||
}
|
||||
|
||||
private void SetWindowsSize()
|
||||
{
|
||||
this.characters.MaxWidth = _powerAccent.GetDisplayMaxWidth();
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
_powerAccent.SaveUsageInfo();
|
||||
|
||||
Reference in New Issue
Block a user