How to change, or/and create new keyboard shortcuts

Frequently Asked Questions regarding XnView (including Answers)

Moderators: XnTriq, helmut, xnview

Post Reply
Dreamer
XnThusiast
Posts: 4608
Joined: Sun Jul 25, 2004 9:08 pm

How to change, or/and create new keyboard shortcuts

Post by Dreamer »

The current keyboard hotkeys and shortcuts are described in topic 'All Current keyboard Hotkeys & Shortcuts'.

___

It's impossible to change hotkeys / shortcuts in XnView Classic, but there is a workaround - HotkeyP (freeware). Read HotkeyP Help for more information.

It's possible to change, or make new keyboard shorcuts and it's possible to make also global keyboard shorcuts and even use XnView by remote control.

Global guides for all types of keyboard shortcuts:

How to find a command number for desired action:

1. Run XnView.
2. Spy from HotkeyP menu > File.
3. Make desired action (by menu or existing keyboard shortcut) in XnView.
4. Number in "Command" column in Spy is a command number you have to use below as the first parameter.

How to use use a second parameter:

- xnview.exe&(XmainClass|XprevClass) means that keyboard shortcut will be used in Browser, Viewer, Edit fullscreen and Browser fullscreen
- xnview.exe&XmainClass means that keyboard shortcut will be used in Browser, Viewer and Edit fullscreen
- xnview.exe&XprevClass means that keyboard shortcut will be used in Browser fullscreen
- xnview.exe means that keyboard shortcut will be used in in all modes including dialogs (e.g. Rename dialog), so this way it's impossible to make single letter hotkeys, useful for global keyboard shortcuts and remote control

The same "Window Class" is used for Browser, Viewer and Edit fullscreen, therefore usage of the same keyboard shortcuts for different actions in more modes is limited - but not impossible, it might work in some cases.

Custom keyboard shortcuts:

Guide - how to make new commands in HotkeyP for XnView:

1. Go to menu > Hotkey > and select Insert new.
2. Press a new key / shortcut, e.g. F10
3. In Command field type Command to active window, or choose it from [<] button menu.
4. In Parameters field type a command number (more above), xnview.exe and "Window Class", e.g. 300 xnview.exe&(XmainClass|XprevClass)
5. Press Enter or use OK button to confirm.
6. For additional commands go to menu > Hotkey select Duplicate and repeat steps 2 - 5, just change a hotkey - F10, a command number - 300, if appropriate "Window Class", more in HotkeyP Help.

Global keyboard shortcuts:

Guide - how to make new commands in HotkeyP for XnView:

1. Go to menu > Hotkey > and select Insert new.
2. Press a new shortcut, e.g. Ctrl+Shift+Right
3. In Command field type Send window command, or choose it from [<] button menu.
4. In Parameters field type a command number (more above) and xnview.exe, e.g. 43 xnview.exe
5. Press Enter or use OK button to confirm.
6. For additional commands go to menu > Hotkey > select Duplicate and repeat steps 2 - 5, just change a hotkey - Ctrl+Shift+Right and a command number - 43, more in HotkeyP Help.

Remote control:

You will need WinLIRC (freeware) and supported remote control. Read HotkeyP and WinLIRC Help for more information.

Guide - how to make new commands in HotkeyP for XnView:

1. Download, install, run and set up WinLIRC.
2. In HotkeyP, go to menu > Window > select Options, Remote tab and enable and set up WinLIRC.
3. Go to menu > Hotkey > and select Insert new.
4. Press a new button, e.g. CH+
5. In Command field type Send window command, or choose it from [<] button menu.
6. In Parameters field type a command number (more above) and xnview.exe, e.g. 43 xnview.exe
7. Press Enter or use OK button to confirm.
8. For additional commands go to menu > Hotkey > select Duplicate and repeat steps 4 - 7, just change a hotkey/button - CH+ and a command number - 43, more in HotkeyP Help.

Notes:

- In most cases just the custom keyboard shortcuts make sense, but aso global shortcuts and remote control might be useful sometimes.
- Global keyboard shortcuts will work also if XnView window is not active!
- Global keyboard shortcuts and Remote control don't work in Browser fullscreen, but there is a workaround, use Send keys to window instead of Send window command and type existing/old keyboard shorctut instead of command number, e.g. \pagedown, more in HotkeyP Help.
- You can use also keyboard shortcuts or buttons to Insert new commands, Duplicate, Edit or Delete (not all buttons are enabled by default) in HotkeyP.
- If you have any problem or question, start a new topic in General Support section, but please read the HotkeyP (and WinLIRC) Help first.
Dreamer
Dreamer
XnThusiast
Posts: 4608
Joined: Sun Jul 25, 2004 9:08 pm

Small guide for the capture command line options

Post by Dreamer »

Small guide for the capture command line options.

1. Go to HotkeyP menu > Hotkey > and select "Create new"

2. Use any keyboard/mouse shortcut as a Hot Key

3. Command - it's the same for all options, it's a path to xnview.exe, by default:

C:\Program Files\XnView\xnview.exe

4. Parameters - few examples:

-capture=window
-capture=desktop

-capture=window,c:\file.ext
-capture=desktop,c:\file.ext

-capture=window,c:\file#.ext
-capture=desktop,c:\file_###.ext

-capture=window,d:\screenshot$.ext
-capture=desktop,d:\screenshot_$.ext


# is a number index - #=1, 2, 3..., ###=001, 002, 003...
$ is a date and time - 08132007_214818

Extension is taken from the Capture setup dialog. Path and file name is customizable. Screenshot is created, saved and then XnView exits, when using path and file name.

If you want to open the screenshot in XnView, then don't use path and file name parameters and use option "Open in XnView" in the Capture dialog.

You can create a desktop shortcut with those parameters and assign a shortcut key / hotkey, then it's possible to make screenshot(s) with a single key - even without HotkeyP.
Dreamer
Phred
Posts: 40
Joined: Fri Nov 06, 2009 3:48 pm
Location: SEAu

Re: How to change, or/and create new keyboard shortcuts

Post by Phred »

Four years later and the command-line switches are just as obscure.

Yes, xnviewmp.exe -capture=desktop,d:\users\public\pictures\your_filename_###.jpg actually works, but what else is there?

And no, Help, About, 'Command line' tab - is blank.

The ? control is unwilling to explain anything. Slashed circle everywhere.

Is there no reference to the command-line switches that XnViewMP responds to?
Windows 10.

I'd simply like to begin XnViewMP from the taskbar in fullscreen mode showing a nominated picture.
Regards, PhredE
Willing donor, if only a 'donor token' were supplied in return, putting 'Phred's XnView' or '$D', '$Dd', '$dd' (depending on size) or 'Donor Version' in the title bar. (See Wiztree for partial solution.)
And a local Help file :(
User avatar
xnview
Author of XnView
Posts: 43327
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: How to change, or/and create new keyboard shortcuts

Post by xnview »

Phred wrote: Thu Aug 02, 2018 2:12 pm Is there no reference to the command-line switches that XnViewMP responds to?
in XnView MP, you have only:
-ini file.ini
-slide file.sld
-filelist list.txt
-capture
Pierre.
Phred
Posts: 40
Joined: Fri Nov 06, 2009 3:48 pm
Location: SEAu

Re: How to change, or/and create new keyboard shortcuts

Post by Phred »

xnview wrote: Sat Aug 04, 2018 9:11 am
Phred wrote: Thu Aug 02, 2018 2:12 pm Is there no reference to the command-line switches that XnViewMP responds to?
in XnView MP, you have only:
-ini file.ini
-slide file.sld
-filelist list.txt
-capture
As they do for unused pages in the frontispieces of many printed books, would you consider putting
'This tab is left blank intentionally'
in Help, About, Command line?

I am happy to report that I can blacken one of my screens while watching video on another with this working nicely:
"C:\Program Files (x86)\XnView\xnview.exe" "D:\Users\Public\Pictures\! B-PC_Public_Pics_D !!\Blackle.jpg" -fi -full
Regards, PhredE
Willing donor, if only a 'donor token' were supplied in return, putting 'Phred's XnView' or '$D', '$Dd', '$dd' (depending on size) or 'Donor Version' in the title bar. (See Wiztree for partial solution.)
And a local Help file :(
tomaasz
Posts: 1
Joined: Sat Jan 04, 2020 12:05 pm

Re: How to change, or/and create new keyboard shortcuts

Post by tomaasz »

Hi
Thanks for guide
I try to use this but have problem because my hotkeys affect for other applications (e.g. Excel) and using hotkey when XnView is closed impact for run XnView.

could you look at printsreen of my settings and help me ?

hk.jpg
hk.jpg (41.52 KiB) Viewed 17716 times
Phred
Posts: 40
Joined: Fri Nov 06, 2009 3:48 pm
Location: SEAu

Re: How to change, or/and create new keyboard shortcuts

Post by Phred »

A thousand pardons, tomaasz - haven't been around.

If it's still current - I don't recognise the dialogue box.
Where's it from - Windows , XnView or XnViewMP?
Regards, PhredE
Willing donor, if only a 'donor token' were supplied in return, putting 'Phred's XnView' or '$D', '$Dd', '$dd' (depending on size) or 'Donor Version' in the title bar. (See Wiztree for partial solution.)
And a local Help file :(
The Electro Machine
Posts: 37
Joined: Tue Feb 16, 2021 8:59 am

Re: How to change, or/and create new keyboard shortcuts

Post by The Electro Machine »

As established here here viewtopic.php?f=82&t=43730, I need to change behavior of pressed ALT + S: from opening window of Export feature to writing letter ś / Ś

Ans so I have created this in HotkeyP

Image

but I still get Export instead of ś / Ś. What am I doing wrong?
Post Reply