File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ class GMCPMessageClientKeystrokesUnbindAll extends GMCPMessage {
2828 // No specific properties needed for this message
2929}
3030
31+ // Message class for the server's request to list bindings
32+ class GMCPMessageClientKeystrokesListBindings extends GMCPMessage {
33+ // No specific properties needed for this message
34+ }
35+
3136export class GMCPClientKeystrokes extends GMCPPackage {
3237 public packageName : string = "Client.Keystrokes" ;
3338 private bindings : KeyBinding [ ] = [ ] ;
@@ -165,6 +170,15 @@ export class GMCPClientKeystrokes extends GMCPPackage {
165170 this . unbindAll ( ) ;
166171 }
167172
173+ // Handler for the server's request to list bindings
174+ public handleListBindings ( data : GMCPMessageClientKeystrokesListBindings ) : void {
175+ // data parameter is unused but kept for consistency
176+ console . log ( "Received Client.Keystrokes.ListBindings request, sending current bindings." ) ; // Optional logging
177+ const bindingsArray = this . listBindings ( ) ;
178+ // Send the list back using the "BindingsList" message name
179+ this . sendData ( "BindingsList" , bindingsArray ) ;
180+ }
181+
168182 public listBindings ( ) : KeyBinding [ ] {
169183 return [ ...this . bindings ] ;
170184 }
You can’t perform that action at this time.
0 commit comments