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
2014-12-20 14:05:54 -08:00
parent b33333da3f
commit eaed778f91
5 changed files with 85 additions and 11 deletions

View File

@@ -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.