GUAC-810: Send "synthetic" key events for non-physical input options. Allow components to prevent production/handling of guacKeyup/guacKeydown via guacBeforeKeyup/guacBeforeKeydown.

This commit is contained in:
Michael Jumper committed 2014-12-20 14:05:54 -08:00
1 parent b33333da3f
commit eaed778f91
5 files changed
+85 -11

No files matched your search

@@ -529,6 +529,16 @@ angular.module('client').directive('guacClient', [function guacClient() {
event.preventDefault();
}
});
// Universally handle all synthetic keydown events
$scope.$on('guacSyntheticKeydown', function syntheticKeydownListener(event, keysym) {
client.sendKeyEvent(1, keysym);
});
// Universally handle all synthetic keyup events
$scope.$on('guacSyntheticKeyup', function syntheticKeyupListener(event, keysym) {
client.sendKeyEvent(0, keysym);
});
/**
* Converts the given bytes to a base64-encoded string.