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 92 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,74 +0,0 @@
// ImageSizeReorderHelper.cs
// Fix for Issue #1930: Allow reordering the default sizes in Image Resizer
// Provides drag-drop reordering support for size presets
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace ImageResizer.Utilities
{
/// <summary>
/// Helper for reordering Image Resizer size presets.
/// </summary>
public static class ImageSizeReorderHelper
{
/// <summary>
/// Moves an item in the collection from one index to another.
/// </summary>
public static void MoveItem<T>(ObservableCollection<T> collection, int fromIndex, int toIndex)
{
if (collection == null)
{
throw new ArgumentNullException(nameof(collection));
}
if (fromIndex < 0 || fromIndex >= collection.Count)
{
throw new ArgumentOutOfRangeException(nameof(fromIndex));
}
if (toIndex < 0 || toIndex >= collection.Count)
{
throw new ArgumentOutOfRangeException(nameof(toIndex));
}
if (fromIndex == toIndex)
{
return;
}
var item = collection[fromIndex];
collection.RemoveAt(fromIndex);
collection.Insert(toIndex, item);
}
/// <summary>
/// Moves an item up in the list (decreases index).
/// </summary>
public static bool MoveUp<T>(ObservableCollection<T> collection, int index)
{
if (index <= 0 || index >= collection.Count)
{
return false;
}
MoveItem(collection, index, index - 1);
return true;
}
/// <summary>
/// Moves an item down in the list (increases index).
/// </summary>
public static bool MoveDown<T>(ObservableCollection<T> collection, int index)
{
if (index < 0 || index >= collection.Count - 1)
{
return false;
}
MoveItem(collection, index, index + 1);
return true;
}
}
}

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>