Skip to content

Commit 9dcddfd

Browse files
authored
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: #29371 #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
1 parent 503bcbd commit 9dcddfd

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

src/modules/poweraccent/PowerAccent.Core/Languages.cs

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private static string[] GetDefaultLetterKeySPECIAL(LetterKey letter)
224224
LetterKey.VK_X => new[] { "ẋ", "×" },
225225
LetterKey.VK_Y => new[] { "ẏ", "ꝡ" },
226226
LetterKey.VK_Z => new[] { "ʒ", "ǯ", "ℤ" },
227-
LetterKey.VK_COMMA => new[] { "∙", "₋", "⁻", "–", "√" }, // – is in VK_MINUS for other languages, but not VK_COMMA, so we add it here.
227+
LetterKey.VK_COMMA => new[] { "∙", "₋", "⁻", "–", "√", "‟", "《", "》", "‛", "〈", "〉", "″", "‴", "⁗" }, // – is in VK_MINUS for other languages, but not VK_COMMA, so we add it here.
228228
LetterKey.VK_PERIOD => new[] { "…", "⁝", "\u0300", "\u0301", "\u0302", "\u0303", "\u0304", "\u0308", "\u030B", "\u030C" },
229229
LetterKey.VK_MINUS => new[] { "~", "‐", "‑", "‒", "—", "―", "⁓", "−", "⸺", "⸻", "∓" },
230230
LetterKey.VK_SLASH_ => new[] { "÷", "√" },
@@ -302,6 +302,7 @@ private static string[] GetDefaultLetterKeyHR(LetterKey letter)
302302
LetterKey.VK_E => new[] { "€" },
303303
LetterKey.VK_S => new[] { "š" },
304304
LetterKey.VK_Z => new[] { "ž" },
305+
LetterKey.VK_COMMA => new[] { "„", "“", "»", "«" },
305306
_ => Array.Empty<string>(),
306307
};
307308
}
@@ -317,6 +318,7 @@ private static string[] GetDefaultLetterKeyEST(LetterKey letter)
317318
LetterKey.VK_U => new[] { "ü" },
318319
LetterKey.VK_Z => new[] { "ž" },
319320
LetterKey.VK_S => new[] { "š" },
321+
LetterKey.VK_COMMA => new[] { "„", "“", "«", "»" },
320322
_ => Array.Empty<string>(),
321323
};
322324
}
@@ -344,6 +346,7 @@ private static string[] GetDefaultLetterKeyFI(LetterKey letter)
344346
LetterKey.VK_A => new[] { "ä", "å" },
345347
LetterKey.VK_E => new[] { "€" },
346348
LetterKey.VK_O => new[] { "ö" },
349+
LetterKey.VK_COMMA => new[] { "”", "’", "»" },
347350
_ => Array.Empty<string>(),
348351
};
349352
}
@@ -360,6 +363,7 @@ private static string[] GetDefaultLetterKeyFR(LetterKey letter)
360363
LetterKey.VK_O => new[] { "ô", "ö", "ó", "ò", "õ", "œ" },
361364
LetterKey.VK_U => new[] { "û", "ù", "ü", "ú" },
362365
LetterKey.VK_Y => new[] { "ÿ", "ý" },
366+
LetterKey.VK_COMMA => new[] { "«", "»", "‹", "›", "“", "”", "‘", "’" },
363367
_ => Array.Empty<string>(),
364368
};
365369
}
@@ -376,6 +380,7 @@ private static string[] GetDefaultLetterKeyIS(LetterKey letter)
376380
LetterKey.VK_U => new[] { "ú" },
377381
LetterKey.VK_Y => new[] { "ý" },
378382
LetterKey.VK_T => new[] { "þ" },
383+
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘" },
379384
_ => Array.Empty<string>(),
380385
};
381386
}
@@ -393,7 +398,7 @@ private static string[] GetDefaultLetterKeySP(LetterKey letter)
393398
LetterKey.VK_N => new[] { "ñ" },
394399
LetterKey.VK_O => new[] { "ó" },
395400
LetterKey.VK_U => new[] { "ú", "ü" },
396-
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!" },
401+
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!", "«", "»", "“", "”", "‘", "’" },
397402
_ => Array.Empty<string>(),
398403
};
399404
}
@@ -411,7 +416,7 @@ private static string[] GetDefaultLetterKeyCA(LetterKey letter)
411416
LetterKey.VK_O => new[] { "ò", "ó" },
412417
LetterKey.VK_U => new[] { "ù", "ú", "ü" },
413418
LetterKey.VK_L => new[] { "·" },
414-
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!" },
419+
LetterKey.VK_COMMA => new[] { "¿", "?", "¡", "!", "«", "»", "“", "”", "‘", "’" },
415420
_ => Array.Empty<string>(),
416421
};
417422
}
@@ -427,6 +432,7 @@ private static string[] GetDefaultLetterKeyMI(LetterKey letter)
427432
LetterKey.VK_O => new[] { "ō" },
428433
LetterKey.VK_S => new[] { "$" },
429434
LetterKey.VK_U => new[] { "ū" },
435+
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’" },
430436
_ => Array.Empty<string>(),
431437
};
432438
}
@@ -443,6 +449,7 @@ private static string[] GetDefaultLetterKeyNL(LetterKey letter)
443449
LetterKey.VK_N => new[] { "ñ" },
444450
LetterKey.VK_O => new[] { "ó", "ö", "ô" },
445451
LetterKey.VK_U => new[] { "ú", "ü", "û" },
452+
LetterKey.VK_COMMA => new[] { "“", "„", "”", "‘", ",", "’" },
446453
_ => Array.Empty<string>(),
447454
};
448455
}
@@ -469,6 +476,7 @@ private static string[] GetDefaultLetterKeyPI(LetterKey letter)
469476
LetterKey.VK_V => new[] { "ü", "ǖ", "ǘ", "ǚ", "ǜ" },
470477
LetterKey.VK_Y => new[] { "¥" },
471478
LetterKey.VK_Z => new[] { "ẑ" },
479+
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’", "「", "」", "『", "』" },
472480
_ => Array.Empty<string>(),
473481
};
474482
}
@@ -505,6 +513,7 @@ private static string[] GetDefaultLetterKeyTK(LetterKey letter)
505513
LetterKey.VK_S => new[] { "ş" },
506514
LetterKey.VK_T => new[] { "₺" },
507515
LetterKey.VK_U => new[] { "ü", "û" },
516+
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’", "«", "»", "‹", "›" },
508517
_ => Array.Empty<string>(),
509518
};
510519
}
@@ -522,6 +531,7 @@ private static string[] GetDefaultLetterKeyPL(LetterKey letter)
522531
LetterKey.VK_O => new[] { "ó" },
523532
LetterKey.VK_S => new[] { "ś" },
524533
LetterKey.VK_Z => new[] { "ż", "ź" },
534+
LetterKey.VK_COMMA => new[] { "„", "”", "‘", "’", "»", "«" },
525535
_ => Array.Empty<string>(),
526536
};
527537
}
@@ -539,7 +549,7 @@ private static string[] GetDefaultLetterKeyPT(LetterKey letter)
539549
LetterKey.VK_P => new[] { "π" },
540550
LetterKey.VK_S => new[] { "$" },
541551
LetterKey.VK_U => new[] { "ú" },
542-
LetterKey.VK_COMMA => new[] { "≤", "≥", "≠", "≈", "≙", "±", "₊", "⁺" },
552+
LetterKey.VK_COMMA => new[] { "≤", "≥", "≠", "≈", "≙", "±", "₊", "⁺", "“", "”", "‘", "’", "«", "»" },
543553
_ => Array.Empty<string>(),
544554
};
545555
}
@@ -594,6 +604,7 @@ private static string[] GetDefaultLetterKeySK(LetterKey letter)
594604
LetterKey.VK_U => new[] { "ú" },
595605
LetterKey.VK_Y => new[] { "ý" },
596606
LetterKey.VK_Z => new[] { "ž" },
607+
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘", "»", "«", "›", "‹" },
597608
_ => Array.Empty<string>(),
598609
};
599610
}
@@ -608,6 +619,7 @@ private static string[] GetDefaultLetterKeyGA(LetterKey letter)
608619
LetterKey.VK_I => new[] { "í" },
609620
LetterKey.VK_O => new[] { "ó" },
610621
LetterKey.VK_U => new[] { "ú" },
622+
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’" },
611623
_ => Array.Empty<string>(),
612624
};
613625
}
@@ -623,6 +635,7 @@ private static string[] GetDefaultLetterKeyGD(LetterKey letter)
623635
LetterKey.VK_O => new[] { "ò" },
624636
LetterKey.VK_P => new[] { "£" },
625637
LetterKey.VK_U => new[] { "ù" },
638+
LetterKey.VK_COMMA => new[] { "“", "”", "‘", "’" },
626639
_ => Array.Empty<string>(),
627640
};
628641
}
@@ -645,6 +658,7 @@ private static string[] GetDefaultLetterKeyCZ(LetterKey letter)
645658
LetterKey.VK_U => new[] { "ů", "ú" },
646659
LetterKey.VK_Y => new[] { "ý" },
647660
LetterKey.VK_Z => new[] { "ž" },
661+
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘", "»", "«", "›", "‹" },
648662
_ => Array.Empty<string>(),
649663
};
650664
}
@@ -659,6 +673,7 @@ private static string[] GetDefaultLetterKeyDE(LetterKey letter)
659673
LetterKey.VK_O => new[] { "ö" },
660674
LetterKey.VK_S => new[] { "ß" },
661675
LetterKey.VK_U => new[] { "ü" },
676+
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘", "»", "«", "›", "‹" },
662677
_ => Array.Empty<string>(),
663678
};
664679
}
@@ -689,6 +704,7 @@ private static string[] GetDefaultLetterKeyEL(LetterKey letter)
689704
LetterKey.VK_X => new string[] { "ξ" },
690705
LetterKey.VK_Y => new string[] { "υ" },
691706
LetterKey.VK_Z => new string[] { "ζ" },
707+
LetterKey.VK_COMMA => new[] { "“", "”", "«", "»", },
692708
_ => Array.Empty<string>(),
693709
};
694710
}
@@ -710,7 +726,7 @@ private static string[] GetDefaultLetterKeyHE(LetterKey letter)
710726
LetterKey.VK_U => new[] { "וֹ", "וּ", "װ", "\u05b9" },
711727
LetterKey.VK_X => new[] { "\u05b6", "\u05b1" },
712728
LetterKey.VK_Y => new[] { "ױ" },
713-
LetterKey.VK_COMMA => new[] { "”", "’", "״", "׳" },
729+
LetterKey.VK_COMMA => new[] { "”", "’", "'", "״", "׳" },
714730
LetterKey.VK_PERIOD => new[] { "\u05ab", "\u05bd", "\u05bf" },
715731
LetterKey.VK_MINUS => new[] { "–", "־" },
716732
_ => Array.Empty<string>(),
@@ -727,6 +743,7 @@ private static string[] GetDefaultLetterKeyHU(LetterKey letter)
727743
LetterKey.VK_I => new[] { "í" },
728744
LetterKey.VK_O => new[] { "ó", "ő", "ö" },
729745
LetterKey.VK_U => new[] { "ú", "ű", "ü" },
746+
LetterKey.VK_COMMA => new[] { "„", "”", "»", "«" },
730747
_ => Array.Empty<string>(),
731748
};
732749
}
@@ -740,6 +757,7 @@ private static string[] GetDefaultLetterKeyRO(LetterKey letter)
740757
LetterKey.VK_I => new[] { "î" },
741758
LetterKey.VK_S => new[] { "ș" },
742759
LetterKey.VK_T => new[] { "ț" },
760+
LetterKey.VK_COMMA => new[] { "„", "”", "«", "»" },
743761
_ => Array.Empty<string>(),
744762
};
745763
}
@@ -754,6 +772,7 @@ private static string[] GetDefaultLetterKeyIT(LetterKey letter)
754772
LetterKey.VK_I => new[] { "ì", "í" },
755773
LetterKey.VK_O => new[] { "ò", "ó" },
756774
LetterKey.VK_U => new[] { "ù", "ú" },
775+
LetterKey.VK_COMMA => new[] { "«", "»", "“", "”", "‘", "’" },
757776
_ => Array.Empty<string>(),
758777
};
759778
}
@@ -772,6 +791,7 @@ private static string[] GetDefaultLetterKeyKU(LetterKey letter)
772791
LetterKey.VK_R => new[] { "ř" },
773792
LetterKey.VK_S => new[] { "ş" },
774793
LetterKey.VK_U => new[] { "û", "ü" },
794+
LetterKey.VK_COMMA => new[] { "«", "»", "“", "”" },
775795
_ => Array.Empty<string>(),
776796
};
777797
}
@@ -789,6 +809,7 @@ private static string[] GetDefaultLetterKeyCY(LetterKey letter)
789809
LetterKey.VK_U => new[] { "û", "ü", "ù", "ú" },
790810
LetterKey.VK_Y => new[] { "ŷ", "ÿ", "ỳ", "ý" },
791811
LetterKey.VK_W => new[] { "ŵ", "ẅ", "ẁ", "ẃ" },
812+
LetterKey.VK_COMMA => new[] { "‘", "’", "“", "“" },
792813
_ => Array.Empty<string>(),
793814
};
794815
}
@@ -801,6 +822,7 @@ private static string[] GetDefaultLetterKeySV(LetterKey letter)
801822
LetterKey.VK_A => new[] { "å", "ä" },
802823
LetterKey.VK_E => new[] { "é" },
803824
LetterKey.VK_O => new[] { "ö" },
825+
LetterKey.VK_COMMA => new[] { "”", "’", "»", "«" },
804826
_ => Array.Empty<string>(),
805827
};
806828
}
@@ -814,6 +836,7 @@ private static string[] GetDefaultLetterKeySR(LetterKey letter)
814836
LetterKey.VK_D => new[] { "đ" },
815837
LetterKey.VK_S => new[] { "š" },
816838
LetterKey.VK_Z => new[] { "ž" },
839+
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "’", "»", "«", "›", "‹" },
817840
_ => Array.Empty<string>(),
818841
};
819842
}
@@ -838,6 +861,7 @@ private static string[] GetDefaultLetterKeyMK(LetterKey letter)
838861
{
839862
LetterKey.VK_E => new[] { "ѐ" },
840863
LetterKey.VK_I => new[] { "ѝ" },
864+
LetterKey.VK_COMMA => new[] { "„", "“", "’", "‘" },
841865
_ => Array.Empty<string>(),
842866
};
843867
}
@@ -869,6 +893,7 @@ private static string[] GetDefaultLetterKeyNO(LetterKey letter)
869893
LetterKey.VK_E => new[] { "€", "é" },
870894
LetterKey.VK_O => new[] { "ø" },
871895
LetterKey.VK_S => new[] { "$" },
896+
LetterKey.VK_COMMA => new[] { "«", "»", ",", "‘", "’", "„", "“" },
872897
_ => Array.Empty<string>(),
873898
};
874899
}
@@ -881,6 +906,7 @@ private static string[] GetDefaultLetterKeyDK(LetterKey letter)
881906
LetterKey.VK_A => new[] { "å", "æ" },
882907
LetterKey.VK_E => new[] { "€" },
883908
LetterKey.VK_O => new[] { "ø" },
909+
LetterKey.VK_COMMA => new[] { "»", "«", "“", "”", "›", "‹", "‘", "’" },
884910
_ => Array.Empty<string>(),
885911
};
886912
}
@@ -897,6 +923,7 @@ private static string[] GetDefaultLetterKeyLT(LetterKey letter)
897923
LetterKey.VK_S => new[] { "š" },
898924
LetterKey.VK_U => new[] { "ų", "ū" },
899925
LetterKey.VK_Z => new[] { "ž" },
926+
LetterKey.VK_COMMA => new[] { "„", "“", "‚", "‘" },
900927
_ => Array.Empty<string>(),
901928
};
902929
}
@@ -910,6 +937,7 @@ private static string[] GetDefaultLetterKeySL(LetterKey letter)
910937
LetterKey.VK_E => new[] { "€" },
911938
LetterKey.VK_S => new[] { "š" },
912939
LetterKey.VK_Z => new[] { "ž" },
940+
LetterKey.VK_COMMA => new[] { "„", "“", "»", "«" },
913941
_ => Array.Empty<string>(),
914942
};
915943
}

src/modules/poweraccent/PowerAccent.Core/PowerAccent.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public partial class PowerAccent : IDisposable
2020

2121
// Keys that show a description (like dashes) when ShowCharacterInfoSetting is 1
2222
private readonly LetterKey[] _letterKeysShowingDescription = new LetterKey[] { LetterKey.VK_O };
23+
private const double ScreenMinPadding = 150;
2324

2425
private bool _visible;
2526
private string[] _characters = Array.Empty<string>();
@@ -332,6 +333,11 @@ public Point GetDisplayCoordinates(Size window)
332333
return Calculation.GetRawCoordinatesFromPosition(position, screen, window);
333334
}
334335

336+
public double GetDisplayMaxWidth()
337+
{
338+
return WindowsFunctions.GetActiveDisplay().Size.Width - ScreenMinPadding;
339+
}
340+
335341
public Position GetToolbarPosition()
336342
{
337343
return _settingService.Position;

src/modules/poweraccent/PowerAccent.UI/Selector.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ private void PowerAccent_OnSelectionCharacter(int index, string character)
5959
_selectedIndex = index;
6060
characters.SelectedIndex = _selectedIndex;
6161
characterName.Text = _powerAccent.CharacterDescriptions[_selectedIndex];
62+
characters.ScrollIntoView(character);
6263
}
6364

6465
private void PowerAccent_OnChangeDisplay(bool isActive, string[] chars)
@@ -73,6 +74,7 @@ private void PowerAccent_OnChangeDisplay(bool isActive, string[] chars)
7374
characters.ItemsSource = chars;
7475
characters.SelectedIndex = _selectedIndex;
7576
this.UpdateLayout(); // Required for filling the actual width/height before positioning.
77+
SetWindowsSize();
7678
SetWindowPosition();
7779
Show();
7880
Microsoft.PowerToys.Telemetry.PowerToysTelemetry.Log.WriteEvent(new PowerAccent.Core.Telemetry.PowerAccentShowAccentMenuEvent());
@@ -96,6 +98,11 @@ private void SetWindowPosition()
9698
this.Top = position.Y;
9799
}
98100

101+
private void SetWindowsSize()
102+
{
103+
this.characters.MaxWidth = _powerAccent.GetDisplayMaxWidth();
104+
}
105+
99106
protected override void OnClosed(EventArgs e)
100107
{
101108
_powerAccent.SaveUsageInfo();

0 commit comments

Comments
 (0)