$event.which provides code to mouse clicks. We can make use of that. Pass $event to function as parameter. 
  • 1 for Left mouse button
  • 2 for Middle mouse button
  • 3 for Right mouse button

Markup

<div ng-mouseup="whichKey($event)">
Mouse click here ( right or left )
</div>

Script

switch ($event.which) {
     case 1:
         alert('Left Mouse button pressed.');
         break;
     case 2:
         alert('Middle Mouse button pressed.');
         break;
     case 3:
         alert('Right Mouse button pressed.');
         break;
     default:
         alert('You have a strange Mouse!');
 }

2 comments:

  1. Good blog. Keep sharing. I love them Are you also searching for Spanish writing help? we are the best solution for you. We are best known for delivering Spanish writing services to students without having to break the bank

    ReplyDelete
  2. Your blogs are authentic. I love them .Are you also searching for essay help? we are the best solution for you. We are best known for delivering quality essay help.

    ReplyDelete

Blogroll

Popular Posts