Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e3acb5ca
Unverified
Commit
e3acb5ca
authored
Jul 08, 2019
by
Dan Field
Committed by
GitHub
Jul 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor keymapping for resident_runner (#35762)
parent
f3150ed0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
65 deletions
+95
-65
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+85
-65
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+10
-0
No files found.
packages/flutter_tools/lib/src/resident_runner.dart
View file @
e3acb5ca
...
...
@@ -807,78 +807,98 @@ abstract class ResidentRunner {
/// Returns [true] if the input has been handled by this function.
Future
<
bool
>
_commonTerminalInputHandler
(
String
character
)
async
{
final
String
lower
=
character
.
toLowerCase
();
printStatus
(
''
);
// the key the user tapped might be on this line
if
(
lower
==
'h'
||
lower
==
'?'
)
{
// help
printHelp
(
details:
true
);
return
true
;
}
else
if
(
lower
==
'w'
)
{
if
(
supportsServiceProtocol
)
{
await
_debugDumpApp
();
return
true
;
}
}
else
if
(
lower
==
't'
)
{
if
(
supportsServiceProtocol
)
{
await
_debugDumpRenderTree
();
return
true
;
}
}
else
if
(
character
==
'L'
)
{
if
(
supportsServiceProtocol
)
{
await
_debugDumpLayerTree
();
switch
(
character
)
{
case
'a'
:
if
(
supportsServiceProtocol
)
{
await
_debugToggleProfileWidgetBuilds
();
return
true
;
}
return
false
;
case
'd'
:
case
'D'
:
await
detach
();
return
true
;
}
}
else
if
(
character
==
'S'
)
{
if
(
supportsServiceProtocol
)
{
await
_debugDumpSemanticsTreeInTraversalOrder
();
case
'h'
:
case
'H'
:
case
'?'
:
// help
printHelp
(
details:
true
);
return
true
;
}
}
else
if
(
character
==
'U'
)
{
if
(
supportsServiceProtocol
)
{
await
_debugDumpSemanticsTreeInInverseHitTestOrder
();
return
true
;
}
}
else
if
(
character
==
'p'
)
{
if
(
supportsServiceProtocol
&&
isRunningDebug
)
{
await
_debugToggleDebugPaintSizeEnabled
();
case
'i'
:
case
'I'
:
if
(
supportsServiceProtocol
)
{
await
_debugToggleWidgetInspector
();
return
true
;
}
return
false
;
case
'L'
:
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
;
}
}
else
if
(
character
==
'P'
)
{
if
(
supportsServiceProtocol
)
{
await
_debugTogglePerformanceOverlayOverride
();
}
}
else
if
(
lower
==
'i'
)
{
if
(
supportsServiceProtocol
)
{
await
_debugToggleWidgetInspector
();
case
's'
:
for
(
FlutterDevice
device
in
flutterDevices
)
{
if
(
device
.
device
.
supportsScreenshot
)
await
_screenshot
(
device
);
}
return
true
;
}
}
else
if
(
character
==
's'
)
{
for
(
FlutterDevice
device
in
flutterDevices
)
{
if
(
device
.
device
.
supportsScreenshot
)
await
_screenshot
(
device
);
}
return
true
;
}
else
if
(
character
==
'a'
)
{
if
(
supportsServiceProtocol
)
{
await
_debugToggleProfileWidgetBuilds
();
}
}
else
if
(
lower
==
'o'
)
{
if
(
supportsServiceProtocol
&&
isRunningDebug
)
{
await
_debugTogglePlatform
();
case
'S'
:
if
(
supportsServiceProtocol
)
{
await
_debugDumpSemanticsTreeInTraversalOrder
();
return
true
;
}
return
false
;
case
't'
:
case
'T'
:
if
(
supportsServiceProtocol
)
{
await
_debugDumpRenderTree
();
return
true
;
}
return
false
;
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
;
}
}
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
;
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
e3acb5ca
...
...
@@ -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
;
Future
<
void
>
flushUIThreadTasks
()
async
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment