Fix the character field of the RawKeyEvent to hold correct data on non-Android platforms. (#65667)
This fixes a problem where the character field of the RawKeyEvent was not being set at all for non-Android platforms. I also updated the key maps, and corrected a problem with the Windows key map where the backquote character wasn't correctly mapped.
This commit is contained in:
@@ -79,6 +79,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
final String modifierList = data.modifiersPressed.keys.map<String>(_getEnumName).join(', ').replaceAll('Modifier', '');
|
||||
final List<Widget> dataText = <Widget>[
|
||||
Text('${_event.runtimeType}'),
|
||||
if (_event.character?.isNotEmpty ?? false) Text('character produced: "${_event.character}"'),
|
||||
Text('modifiers set: $modifierList'),
|
||||
];
|
||||
if (data is RawKeyEventDataAndroid) {
|
||||
@@ -114,6 +115,10 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
dataText.add(Text('scanCode: ${data.scanCode}'));
|
||||
dataText.add(Text('characterCodePoint: ${data.characterCodePoint}'));
|
||||
dataText.add(Text('modifiers: ${data.modifiers} (${_asHex(data.modifiers)})'));
|
||||
} else if (data is RawKeyEventDataWeb) {
|
||||
dataText.add(Text('key: ${data.key}'));
|
||||
dataText.add(Text('code: ${data.code}'));
|
||||
dataText.add(Text('metaState: ${data.metaState} (${_asHex(data.metaState)})'));
|
||||
}
|
||||
dataText.add(Text('logical: ${_event.logicalKey}'));
|
||||
dataText.add(Text('physical: ${_event.physicalKey}'));
|
||||
|
||||
Reference in New Issue
Block a user