private void ControlUp(object code)
{
// Close
if (Config.IsControl(code, Config.Control_Close))
{
CloseNextTick = true;
}
// Dragging
if (Config.IsControl(code, Config.Control_Drag))
{
Dragging = false;
}
// Open Context Menu
if (Config.IsControl(code, Config.Control_OpenContextMenu))
{
ContextMenu.RefreshItems();
ContextMenu.Show(Window.Position.X + MousePos.X - 1, Window.Position.Y + MousePos.Y - 1);
ContextMenu.Capture = true;
}
// Rotate Image
if (Config.IsControl(code, Config.Control_RotateClockwise))
{
RotateImage((int)Image.Rotation + 90);
}
if (Config.IsControl(code, Config.Control_RotateAntiClockwise))
{
RotateImage((int)Image.Rotation - 90);
}
// Flip Image
if (Config.IsControl(code, Config.Control_Flip))
{
FlipImage();
}
// Reset Image
if (Config.IsControl(code, Config.Control_ResetImage))
{
ResetImage();
}
// Fit To Monitor Height/Width
if (Config.IsControl(code, Config.Control_FitToMonitorHeight))
{
ToggleFitToMonitor(Config.HEIGHT);
}
if (Config.IsControl(code, Config.Control_FitToMonitorWidth))
{
ToggleFitToMonitor(Config.WIDTH);
}
if (Config.IsControl(code, Config.Control_FitToMonitorAuto))
{
ToggleFitToMonitor(Config.AUTO);
}
// Animated Image - Pause/Play
if (Config.IsControl(code, Config.Control_PauseAnimation))
{
ToggleAnimation();
}
// Next/Prev Image in Folder
if (!Updated && Config.IsControl(code, Config.Control_PrevImage))
{
PrevImage();
}
if (!Updated && Config.IsControl(code, Config.Control_NextImage))
{
NextImage();
}
// Open config.txt
if (Config.IsControl(code, Config.Control_OpenConfig))
{
OpenConfig();
}
// Reload Config
if (Config.IsControl(code, Config.Control_ReloadConfig))
{
ReloadConfig();
}
// Toggle Settings
if (Config.IsControl(code, Config.Control_ToggleSmoothing))
{
ToggleSmoothing();
}
if (Config.IsControl(code, Config.Control_ToggleBackgroundForTransparency))
{
ToggleBackground();
}
// Toggle Always On Top
if (Config.IsControl(code, Config.Control_ToggleAlwaysOnTop))
{
ToggleAlwaysOnTop();
}
// Open File At Location
if (Config.IsControl(code, Config.Control_OpenAtLocation))
{
OpenFileAtLocation();
}
// Delete File
if (Config.IsControl(code, Config.Control_Delete))
{
DeleteFile();
}
if (Config.IsControl(code, Config.Control_OpenDuplicateImage))
{
Process p = new Process();
p.StartInfo.FileName = Application.ExecutablePath;
p.StartInfo.Arguments = "\"" + File + "\"";
p.Start();
}
ZoomFaster = false;
ZoomAlt = false;
FitToMonitorAlt = false;
}