File tree Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ abstract class InputListenerController {
15
15
16
16
class InputListener extends StatefulWidget {
17
17
InputListener ({
18
+ Key ? key,
18
19
required this .child,
19
20
required this .onKeyStroke,
20
21
required this .onTextInput,
@@ -30,7 +31,7 @@ class InputListener extends StatefulWidget {
30
31
this .inputAction = TextInputAction .done,
31
32
this .keyboardAppearance = Brightness .light,
32
33
this .autocorrect = false ,
33
- });
34
+ }): super (key : key) ;
34
35
35
36
final Widget child;
36
37
final InputHandler onTextInput;
Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ class _TerminalViewState extends State<TerminalView> {
169
169
@override
170
170
Widget build (BuildContext context) {
171
171
return InputListener (
172
+ key: widget.terminal.inputKey,
172
173
listenKeyStroke: widget.inputBehavior.acceptKeyStroke,
173
174
onKeyStroke: onKeyStroke,
174
175
onTextInput: onInput,
Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ import 'dart:async';
2
2
import 'dart:collection' ;
3
3
import 'dart:math' show max, min;
4
4
5
+ import 'package:flutter/src/widgets/framework.dart' ;
5
6
import 'package:xterm/buffer/buffer.dart' ;
6
7
import 'package:xterm/buffer/line/line.dart' ;
8
+ import 'package:xterm/frontend/input_listener.dart' ;
7
9
import 'package:xterm/input/keys.dart' ;
8
10
import 'package:xterm/input/keytab/keytab.dart' ;
9
11
import 'package:xterm/input/keytab/keytab_escape.dart' ;
@@ -40,6 +42,7 @@ class Terminal
40
42
with Observable
41
43
implements TerminalUiInteraction , TerminalSearchInteraction {
42
44
Terminal ({
45
+ this .inputKey,
43
46
this .backend,
44
47
this .onBell = _defaultBellHandler,
45
48
this .onTitleChange = _defaultTitleHandler,
@@ -805,4 +808,7 @@ class Terminal
805
808
setScrollOffsetFromBottom (buffer.height - desiredScrollOffsetFromTop);
806
809
}
807
810
}
811
+
812
+ @override
813
+ GlobalKey <InputListenerState >? inputKey;
808
814
}
Original file line number Diff line number Diff line change
1
+ import 'package:flutter/cupertino.dart' ;
1
2
import 'package:xterm/buffer/line/line.dart' ;
3
+ import 'package:xterm/frontend/input_listener.dart' ;
2
4
import 'package:xterm/input/keys.dart' ;
3
5
import 'package:xterm/mouse/position.dart' ;
4
6
import 'package:xterm/mouse/selection.dart' ;
@@ -12,6 +14,8 @@ abstract class TerminalUiInteraction with Observable {
12
14
/// The theme associated with this Terminal
13
15
TerminalTheme get theme;
14
16
17
+ GlobalKey <InputListenerState >? inputKey;
18
+
15
19
/// the ViewPort scroll offset from the bottom
16
20
int get scrollOffsetFromBottom;
17
21
You can’t perform that action at this time.
0 commit comments