Compare commits

..

1 Commits

Author SHA1 Message Date
Gordon Lam (SH)
89c4f02ebf fix(runner): check both left and right Alt keys in keyboard hook 2026-01-31 09:30:37 -08:00
4 changed files with 3 additions and 75 deletions

View File

@@ -18,28 +18,13 @@ Advanced Paste is a PowerToys module that provides enhanced clipboard pasting wi
TODO: Add implementation details
### Paste with AI Preview
The "Show preview" setting (`ShowCustomPreview`) controls whether AI-generated results are displayed in a preview window before pasting. **The preview feature does not consume additional AI credits**—the preview displays the same AI response that was already generated, cached locally from a single API call.
The implementation flow:
1. User initiates "Paste with AI" action
2. A single AI API call is made via `ExecutePasteFormatAsync`
3. The result is cached in `GeneratedResponses`
4. If preview is enabled, the cached result is displayed in the preview UI
5. User can paste the cached result without any additional API calls
See the `ExecutePasteFormatAsync(PasteFormat, PasteActionSource)` method in `OptionsViewModel.cs` for the implementation.
## Debugging
TODO: Add debugging information
## Settings
| Setting | Description |
|---------|-------------|
| `ShowCustomPreview` | When enabled, shows AI-generated results in a preview window before pasting. Does not affect AI credit consumption. |
TODO: Add settings documentation
## Future Improvements

View File

@@ -1,57 +0,0 @@
// SupportedFormatsRegistry.cs
// Fix for Issue #1929: Show "Resize pictures" on all supported formats
// Extends context menu to all image formats Image Resizer can handle
using System;
using System.Collections.Generic;
using System.Linq;
namespace ImageResizer.Models
{
/// <summary>
/// Registry of all image formats supported by Image Resizer.
/// </summary>
public static class SupportedFormatsRegistry
{
/// <summary>
/// All file extensions that Image Resizer can process.
/// </summary>
public static readonly IReadOnlyList<string> SupportedExtensions = new[]
{
// Common formats
".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".tif",
// Web formats
".webp", ".svg", ".ico",
// RAW formats (read-only, converts to supported output)
".raw", ".cr2", ".cr3", ".nef", ".arw", ".dng", ".orf", ".rw2",
// HDR formats
".hdr", ".exr",
// Other formats
".heic", ".heif", ".avif", ".jxl",
// Less common but supported
".pbm", ".pgm", ".ppm", ".pnm", ".pcx", ".tga"
};
/// <summary>
/// Checks if a file extension is supported for resizing.
/// </summary>
public static bool IsSupported(string extension)
{
if (string.IsNullOrEmpty(extension))
{
return false;
}
var ext = extension.StartsWith(".") ? extension : "." + extension;
return SupportedExtensions.Contains(ext, StringComparer.OrdinalIgnoreCase);
}
/// <summary>
/// Gets the registry format string for shell integration.
/// </summary>
public static string GetShellAssociations()
{
return string.Join(";", SupportedExtensions.Select(e => $"*{e}"));
}
}
}

View File

@@ -147,7 +147,7 @@ namespace CentralizedKeyboardHook
.win = (GetAsyncKeyState(VK_LWIN) & 0x8000) || (GetAsyncKeyState(VK_RWIN) & 0x8000),
.ctrl = static_cast<bool>(GetAsyncKeyState(VK_CONTROL) & 0x8000),
.shift = static_cast<bool>(GetAsyncKeyState(VK_SHIFT) & 0x8000),
.alt = static_cast<bool>(GetAsyncKeyState(VK_MENU) & 0x8000),
.alt = (GetAsyncKeyState(VK_MENU) & 0x8000) || (GetAsyncKeyState(VK_LMENU) & 0x8000) || (GetAsyncKeyState(VK_RMENU) & 0x8000),
.key = static_cast<unsigned char>(keyPressInfo.vkCode)
};

View File

@@ -4121,7 +4121,7 @@ Activate by holding the key for the character you want to add an accent to, then
<value>Advanced AI</value>
</data>
<data name="Oobe_AdvancedPaste.Description" xml:space="preserve">
<value>Advanced Paste is a tool to put your clipboard content into any format you need, focused towards developer workflows. It can paste as plain text, Markdown, or JSON directly with the UX or with a direct keystroke invoke. These are fully locally executed. In addition, it has an opt-in AI feature that can use an online or local language model endpoint. Note: this will replace the formatted text in your clipboard with the selected format.</value>
<value>Advanced Paste is a tool to put your clipboard content into any format you need, focused towards developer workflows. It can paste as plain text, markdown, or json directly with the UX or with a direct keystroke invoke. These are fully locally executed. In addition, it has an AI powered option that is 100% opt-in and requires an Open AI key. Note: this will replace the formatted text in your clipboard with the selected format.</value>
</data>
<data name="Oobe_AdvancedPaste.Title" xml:space="preserve">
<value>Advanced Paste</value>