Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html ng-app="" ng-controller="clickCtrl">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<body ng-keydown="keyDownFunc($event)">
<script>
function clickCtrl($scope, $window) {
$scope.ctrlDown = false;
$scope.ctrlKey = 17, $scope.vKey = 86, $scope.cKey = 67;
$scope.keyDownFunc = function($event) {
if ($scope.ctrlDown && ($event.keyCode == $scope.cKey)) {
alert('Ctrl+C');
} else if ($scope.ctrlDown && ($event.keyCode == $scope.vKey)) {
alert('Ctrl+V');
} else if ($scope.ctrlDown && String.fromCharCode($event.which).toLowerCase() == 's') {
$event.preventDefault();
alert('Ctrl+S');
}
};
angular.element($window).bind("keyup", function($event) {
if ($event.keyCode == $scope.ctrlKey)
$scope.ctrlDown = false;
$scope.$apply();
});
angular.element($window).bind("keydown", function($event) {
if ($event.keyCode == $scope.ctrlKey)
$scope.ctrlDown = true;
$scope.$apply();
});
}
</script>
</body>
</html>
The most helpful ANGULARJS solutions
How to get client ip address using angularjs ?ANGULARJS Click to see more ... 19.2K 2.8K