XaSnap - Screenshot-tool for XaAES and N.AES

Download: xasnap.zip (Changelog)

This program is mainly intended as a companion to Lonny Pursell's ImgView, but it works equally well with ImageCopy, zView or other viewers/converters that can read truecolour IMG-files. If you're not using truecolour screenmodes just about any image-viewer will work.

Install

No installation or configuration is necessary, just run xasnap.app. Run it from xaaes.cnf or let the desktop autostart it to keep it available at all times.

If you want to use it under N.AES or in a more efficient manner under XaAES you will need Keyboard Tweaks to handle the keyboard shortcuts. XaaES accepts three messages in addition to the XaAES snapshot message (see below):

To use this with Keyboard Tweaks add the following lines to kbtweaks.cnf:
Action screenshot_full message "XAAESNAP" 0x5355,apid,0,0,0,0,0,0
Action screenshot_win message "XAAESNAP" 0x5356,apid,0,0,0,0,0,0
Action screenshot_select message "XAAESNAP" 0x5357,apid,0,0,0,0,0,0
This defines an action for each screenshot mode, and you can now set up hotkeys to use these:
Hotkey Alt+Help released action screenshot_full
Hotkey Alt+LShift+Help released action screenshot_win
Hotkey Alt+RShift+Help released action screenshot_win
Hotkey Alt+LShift+s released action screenshot_select
You can use any (within reason, see the Keyboard Tweaks manual) keyboard combination, these are just examples that happens to resemble what I'm used to on my PC.

Use

To take a snapshot press Control+Alt+D. XaAES will now prompt you to either select a block with the mouse, take a screenshot of the top window or the entire screen. Make your choice, and XaSnap will display a dialog with the following options:

(c) joska@online.no, Feb. 2025


The XAAESNAP protocol

When the screenshot keyboard shortcut is pressed (Control+Alt+D by default) XaAES will present you with a dialog where you select what to snap - block (selected with the mouse), top window or entire screen. When you've done your choice XaAES will look for an application with the AES process name "XAAESNAP", and send an AES message to this application:
msg[0]: 0x5354
msg[1]: XaAES apid
msg[2]: -
msg[3]: -
msg[4]: x
msg[5]: y
msg[6]: w
msg[7]: h
x and y is the upper left corner of the rectangle to snap, w and h is width and height.

At this point the XaAES dialog is removed from the screen, but the screen is still locked. XAAESNAP now stores a copy of the portion of the screen given by the coordinates in the message. When this is done XAAESNAP sends a reply to XaAES:

msg[0]: 0x5354
msg[1]: XAAESNAP's apid
msg[2]: -
msg[3]: 1 - success. 0 - failure
msg[4]: -
msg[5]: -
msg[6]: -
msg[7]: -
XaAES will now release the screen, and XAAESNAP is free to display it's own GUI (if any).

NB! At the time of writing (Feb. 2025) there seems to be a couple of problems with this XaAES feature.

  1. Window topping/untopping is messed up after calling the screenshot tool.
  2. Sometimes the screen is not properly unlocked, causing problems for XaSnap and sometimes resulting in a complete lock-up of the screen which requires a restart of XaAES.