on 01-24-2014 11:31 AM
Hello,
I am having requirement to attach keyboard function keys to button press event. for eg. button X should get clicked on pressing function key F5
How we can achieve this in SAPUI5? Kindly let me know.
Regards,
Chandra
I think you could use a jQuery library like hotkeys to bind to the function key browser event, or use the UI5 onKeydown event on the control and then use the fireEvent method trigger the press event on the button?
https://github.com/jeresig/jquery.hotkeys
https://sapui5.hana.ondemand.com/sdk/#docs/guide/EventsInControls.html
Many thanks,
Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Write this following code in your onInit() method:
Here we are handling the keypress event on Control + S key combination.
$(document).keydown(function(evt){
if (evt.keyCode==83 && (evt.ctrlKey)){
evt.preventDefault();
alert('worked');
}
});
Regards,
Shubham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.