@@ -1401,7 +1401,11 @@ bool HandleKey(InputEvent evt)
1401
1401
{
1402
1402
#if FAIRYGUI_INPUT_SYSTEM
1403
1403
if ( ! evt . ctrlOrCmd && ( c == '\n ' || c == '\r ' || c == '\t ' || c == 25 || c == 3 ) )
1404
+ {
1405
+ _keydownFrame = Time . frameCount ;
1406
+ _keydownChar = c ;
1404
1407
HandleTextInput ( c ) ;
1408
+ }
1405
1409
#else
1406
1410
if ( ! evt . ctrlOrCmd )
1407
1411
HandleTextInput ( c ) ;
@@ -1528,6 +1532,8 @@ public static string compositionString
1528
1532
1529
1533
#else
1530
1534
static string _compositionString = string . Empty ;
1535
+ static int _keydownFrame ;
1536
+ static char _keydownChar ;
1531
1537
1532
1538
public static void RegisterEvent ( )
1533
1539
{
@@ -1569,13 +1575,17 @@ static void OnIMECompositionChange(IMECompositionString composition)
1569
1575
1570
1576
static void OnTextInput ( char c )
1571
1577
{
1572
- // filter control chars
1573
- // if Active input handling is BOTH, we will receive these controls chars in this callback
1574
- // howeveer, if Active input handling is New, we will not receive these controls chars in this callback
1575
- if ( c < 32 && c != 3 && c != '\t ' && c != '\n ' && c != '\r ' && c != 25
1576
- || c >= 127 && c <= 159
1577
- || c >= 63232 && c <= 63235 //why arrow keys have these codes?
1578
- )
1578
+ Keyboard keyboard = Keyboard . current ;
1579
+ if ( keyboard . ctrlKey . isPressed || Keyboard . current . altKey . isPressed
1580
+ || keyboard . leftCommandKey . isPressed || keyboard . rightCommandKey . isPressed
1581
+ )
1582
+ return ;
1583
+
1584
+ if ( _keydownFrame == Time . frameCount && _keydownChar == c )
1585
+ return ;
1586
+
1587
+ if ( c < 32 || c >= 127 && c <= 159
1588
+ || c >= 0xF700 && c <= 0xF7FF /*why home/end/arrow-keys have these codes?*/ )
1579
1589
return ;
1580
1590
1581
1591
var focus = Stage . inst . focus ;
0 commit comments