I want to change some keyboard shortcuts behavior. For example: Commands["ActualSize"].Shortcut.Key uses CTRL+0 and I would like CTRL+1 imitating Adobe Reader. I tried to set Commands[""ActualSize""].Shortcut.Key without success.
I also tried to capture keyboard event and change keyboard behavior but PDFXChange freezes when I execute new command even if I use "Notifications.Keyboard.Skip" = 1 at the of event treatment.
Another way? Any chance to do this?
Change Keyboard Shortcut behavior
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 37
- Joined: Thu Jan 01, 1970 12:00 am
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Change Keyboard Shortcut behavior
The code-snippet:I want to change some keyboard shortcuts behavior. For example: Commands["ActualSize"].Shortcut.Key uses CTRL+0 and I would like CTRL+1 imitating Adobe Reader. I tried to set Commands[""ActualSize""].Shortcut.Key without success.
Code: Select all
// set CTLT+'1' for 'ActualSize' command
pdfViewer.SetProperty("Commands[\"ActualSize\"].Shortcut.Modifiers", 0x08); // standard windows FCONTROL constant (winuser.h)
pdfViewer.SetProperty("Commands[\"ActualSize\"].Shortcut.Key", 0x31); // '1'
// to resolve conflict with existing the same shortcut set CTLT+'0' for 'FitPage' command:
pdfViewer.SetProperty("Commands[\"FitPage\"].Shortcut.Modifiers", 0x08);
pdfViewer.SetProperty("Commands[\"FitPage\"].Shortcut.Key", 0x30); // '0'
Do not call 'ExecuteCommand' directly inside your 'OnEvent'-handler. Make it asynchronously (by PostMessage, fast timer, etc.).I also tried to capture keyboard event and change keyboard behavior but PDFXChange freezes when I execute new command even if I use "Notifications.Keyboard.Skip" = 1 at the of event treatment.
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 37
- Joined: Thu Jan 01, 1970 12:00 am
Re: Change Keyboard Shortcut behavior
Thanks! It works!
I was not setting "Commands[""ActualSize""].Shortcut.Modifiers" ...
I was not setting "Commands[""ActualSize""].Shortcut.Modifiers" ...
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am