Unverified Commit e3acb5ca authored by Dan Field's avatar Dan Field Committed by GitHub

Refactor keymapping for resident_runner (#35762)

parent f3150ed0
...@@ -807,78 +807,98 @@ abstract class ResidentRunner { ...@@ -807,78 +807,98 @@ abstract class ResidentRunner {
/// Returns [true] if the input has been handled by this function. /// Returns [true] if the input has been handled by this function.
Future<bool> _commonTerminalInputHandler(String character) async { Future<bool> _commonTerminalInputHandler(String character) async {
final String lower = character.toLowerCase();
printStatus(''); // the key the user tapped might be on this line printStatus(''); // the key the user tapped might be on this line
switch(character) {
if (lower == 'h' || lower == '?') { case 'a':
// help if (supportsServiceProtocol) {
printHelp(details: true); await _debugToggleProfileWidgetBuilds();
return true; return true;
} else if (lower == 'w') { }
if (supportsServiceProtocol) { return false;
await _debugDumpApp(); case 'd':
return true; case 'D':
} await detach();
} else if (lower == 't') {
if (supportsServiceProtocol) {
await _debugDumpRenderTree();
return true;
}
} else if (character == 'L') {
if (supportsServiceProtocol) {
await _debugDumpLayerTree();
return true; return true;
} case 'h':
} else if (character == 'S') { case 'H':
if (supportsServiceProtocol) { case '?':
await _debugDumpSemanticsTreeInTraversalOrder(); // help
printHelp(details: true);
return true; return true;
} case 'i':
} else if (character == 'U') { case 'I':
if (supportsServiceProtocol) { if (supportsServiceProtocol) {
await _debugDumpSemanticsTreeInInverseHitTestOrder(); await _debugToggleWidgetInspector();
return true; return true;
} }
} else if (character == 'p') { return false;
if (supportsServiceProtocol && isRunningDebug) { case 'L':
await _debugToggleDebugPaintSizeEnabled(); if (supportsServiceProtocol) {
await _debugDumpLayerTree();
return true;
}
return false;
case 'o':
case 'O':
if (supportsServiceProtocol && isRunningDebug) {
await _debugTogglePlatform();
return true;
}
return false;
case 'p':
if (supportsServiceProtocol && isRunningDebug) {
await _debugToggleDebugPaintSizeEnabled();
return true;
}
return false;
case 'P':
if (supportsServiceProtocol) {
await _debugTogglePerformanceOverlayOverride();
return true;
}
return false;
case 'q':
case 'Q':
// exit
await exit();
return true; return true;
} case 's':
} else if (character == 'P') { for (FlutterDevice device in flutterDevices) {
if (supportsServiceProtocol) { if (device.device.supportsScreenshot)
await _debugTogglePerformanceOverlayOverride(); await _screenshot(device);
} }
} else if (lower == 'i') {
if (supportsServiceProtocol) {
await _debugToggleWidgetInspector();
return true; return true;
} case 'S':
} else if (character == 's') { if (supportsServiceProtocol) {
for (FlutterDevice device in flutterDevices) { await _debugDumpSemanticsTreeInTraversalOrder();
if (device.device.supportsScreenshot) return true;
await _screenshot(device); }
} return false;
return true; case 't':
} else if (character == 'a') { case 'T':
if (supportsServiceProtocol) { if (supportsServiceProtocol) {
await _debugToggleProfileWidgetBuilds(); await _debugDumpRenderTree();
} return true;
} else if (lower == 'o') { }
if (supportsServiceProtocol && isRunningDebug) { return false;
await _debugTogglePlatform(); case 'U':
if (supportsServiceProtocol) {
await _debugDumpSemanticsTreeInInverseHitTestOrder();
return true;
}
return false;
case 'w':
case 'W':
if (supportsServiceProtocol) {
await _debugDumpApp();
return true;
}
return false;
case 'z':
case 'Z':
await _debugToggleDebugCheckElevationsEnabled();
return true; return true;
}
} else if (lower == 'q') {
// exit
await exit();
return true;
} else if (lower == 'd') {
await detach();
return true;
} else if (lower == 'z') {
await _debugToggleDebugCheckElevationsEnabled();
return true;
} }
return false; return false;
......
...@@ -1471,6 +1471,16 @@ class FlutterView extends ServiceObject { ...@@ -1471,6 +1471,16 @@ class FlutterView extends ServiceObject {
}); });
} }
Future<void> setSemanticsEnabled(bool enabled) async {
assert(enabled != null);
await owner.vmService.vm.invokeRpc<ServiceObject>('_flutter.setSemanticsEnabled',
params: <String, dynamic>{
'isolateId': _uiIsolate.id,
'viewId': id,
'enabled': enabled,
});
}
bool get hasIsolate => _uiIsolate != null; bool get hasIsolate => _uiIsolate != null;
Future<void> flushUIThreadTasks() async { Future<void> flushUIThreadTasks() async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment