File tree Expand file tree Collapse file tree
src/UniGetUI/Pages/SoftwarePages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 Name =" ABSTRACT_PAGE"
1414 NavigationCacheMode =" Required"
1515 xmlns : animations =" using:CommunityToolkit.WinUI.Animations" xmlns : pkgClasses =" using:UniGetUI.PackageEngine.PackageClasses"
16- KeyDown =" {x:Bind PackageList_KeyDown }" >
16+ CharacterReceived =" {x:Bind PackageList_CharacterReceived }" >
1717 <!-- PreviewKeyDown="{x:Bind PackageList_PreviewKeyDown}" -->
1818
1919 <animations : Implicit .ShowAnimations>
Original file line number Diff line number Diff line change @@ -490,18 +490,20 @@ private void SelectAndScrollTo(int index)
490490 ) ) ;
491491 }
492492
493- public void PackageList_KeyDown ( object sender , KeyRoutedEventArgs e )
493+ public void PackageList_CharacterReceived ( object sender , CharacterReceivedRoutedEventArgs e )
494494 {
495- string key = ( ( char ) e . Key ) . ToString ( ) . ToLower ( ) ;
496- if ( "abcdefghijklmnopqrsztuvwxyz1234567890" . IndexOf ( key ) > - 1 )
495+ char ch = Char . ToLower ( e . Character ) ;
496+
497+ if ( ( 'a' <= ch && ch <= 'z' )
498+ || ( '0' <= ch && ch <= '9' ) )
497499 {
498500 if ( Environment . TickCount - LastKeyDown > QUERY_SEPARATION_TIME )
499501 {
500- TypeQuery = key ;
502+ TypeQuery = ch . ToString ( ) ;
501503 }
502504 else
503505 {
504- TypeQuery += key ;
506+ TypeQuery += ch . ToString ( ) ;
505507 }
506508
507509 int IdQueryIndex = - 1 ;
You can’t perform that action at this time.
0 commit comments