Disable Keyboard Shortcuts and Combination Keys with C# (2): Disable Win + L

本文介绍了一种通过修改Windows注册表来禁用或启用Win+L快捷键的方法,并提供了一个C#程序来实现这一功能,无需重启计算机。
    The function of Win + L combination keys is to lock the computer or to switch users on Windows platform. The method introduced in the previous blog article can disable Win key, but cannot disable Win + L shortcut. So we must look for other ways. There is a DWORD (32-bit) value named by 'DisableLockWorkstation' in Windows registry. Its location is under the key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System
    If there does not exist such a value, you can create it manually. To set the value as 0 will enable Win + L, to set the value as 1 will disable the combination. It's difficult and danger to require common users to modify Windows registry. To develop a specialized program is better. A C# program is given here. When it is run, the interface is as follows:


Step:
1. Create a C# Windows Forms application in Visual Studio. The project name is 'EnableOrDisableWinAndL';
2. Switch from code view to designer view, drag a label into the Windows Form from the toolbox. The label text is 'Enable or Disable Win + L ?'.
3. Drag three buttons into the Windows Form from the toolbox, named them by EnableButton, DisableButton and ExitButton;
4. Modify the file 'Form1.cs', the source code is as listed below:

/**************************************************
* Author: HAN Wei
* Author's blog: http://blog.youkuaiyun.com/henter/
* Date: Dec. 5th, 2016
* Description: demonstrate how to disable Win + L combination keys
**************************************************/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;

namespace EnableOrDisableWinAndL
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        void SetRegistryValue(int value)
        {
            const string keyName = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
            try
            {
                Registry.SetValue(keyName, "DisableLockWorkstation", value, RegistryValueKind.DWord);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }

        private void EnableButton_Click(object sender, EventArgs e)
        {
            SetRegistryValue(0);
        }

        private void DisableButton_Click(object sender, EventArgs e)
        {
            SetRegistryValue(1);
        }

        private void ExitButton_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}


5. Build the program, run it with Administrator Privileges. It is unnecessary to restart the computer.



设置Chrome的自定义键盘快捷键(浏览至chrome:// extensions / shortcuts)。 此扩展程序增加了为Chrome设置25种不同的自定义键盘快捷键的功能。 没有此扩展程序,Chrome将无法更改或覆盖任何默认键盘快捷键。 根据设计,此扩展程序完全不需要任何其他Chrome权限。 一切都在Chrome中本地执行,因此不需要访问任何网站或数据。 所有25个键盘快捷键设置都是可选的,可以随时更改。 Chrome扩展程序当前限制为默认的4个“ suggested_key”。 前四个快捷方式具有默认值(可以更改),但是您需要为所需的任何其他快捷方式设置值。 可以在chrome:// extensions / shortcuts上更改所有键盘快捷键。 您可以通过地址栏或单击“键盘快捷方式”扩展程序图标导航到那里。 可以设置的键盘快捷键列表:选择上一个选项卡选择下一个选项卡向左移动当前选项卡向右移动当前选项卡打开Chrome书签(chrome:// bookmarks)打开Chrome下载(chrome:// downloads)打开扩展(chrome://扩展程序)打开扩展程序快捷方式(chrome:// extensions / shortcuts)打开Chrome标志(chrome:// flags)打开Chrome帮助(chrome:// help)打开Chrome历史记录(chrome:// history)打开Chrome设置(chrome: //设置)关闭当前标签页新建标签页从内存中卸载标签页复制当前标签页回到上一页前进至下一页将当前标签页移至第一页将当前标签页移至最后一页静音/取消静音当前标签页固定/取消固定当前标签页重新加载标签页新窗口新隐身窗口图标设计:Freepik从www.flaticon.com制作的扩展图标 支持语言:English
# 问题--设置代码补全 * `Continue - open-source AI code assistant`插件怎么添加代码补全功能呢? * 使用的是购买的deepseek api。 * 面板上有这些选项,第一个`settings`: ```text Settings Indexing③ Help4 Shortcuts User settings Show Session Tabs Wrap Codeblocks Show Chat Scrollbar Text-to-Speech Output Enable Session Titles Format Markdown Allow Anonymous Telemetry Enable Indexing Font Size14 Multiline AutocompletionsAuto Autocomplete Timeout (ms)150 Autocomplete Debounce (ms)250 Disable autocomplete in files Comma-separated list of path matchers Experimental Settings Auto-Accept Agent Edits Add Current File by Default Enable experimental tools @Codebase: use tool calling only ``` * `indexing`: ```text @codebase index Local embeddings of your codebase Indexing complete Click to re-index ``` * `help`: ```text Help center Continue Hub Visit hub.continue.dev to explore custom assistants and blocks Documentation Learn how to configure and use Continue Have an issue? Let us know on GitHub and we'll do our5 best to resolve it Join the community! Join us on Discord to stay up-to-date on the latest developments Token usage Daily token usage across models国 Quickstart Reopen the quickstart and tutorial file ``` * `shortcuts`: ```text Keyboard shortcuts Toggle Selected Model:Ctrl+ Edit highlighted code:Ctrl + I New Chat / New Chat With Selected Code / Close Continue Sidebar IfCtrl+L Chat Already In Focus: Cancel response:Ctrl + Backspace β Toggle inline edit focus:Ctrl+Shiftt+I Focus Current Chat / Add Selected Code To Current Chat / Close ContinueCtrl + Shift +L Sidebar If Chat Already In Focus: Debug Terminal:Ctrl+ Shift + R Reject Diff:Ctrl+Shift+Backspace β Accept Diff:Ctrl + Shift+Enter Reject Top Change in Diff:Alt + Ctrl + N Accept Top Change in Diff:Alt + Ctrl +Y Toggle Autocomplete Enabled:Ctrl + K + Ctrl + A Force an Autocomplete Trigger:Ctrlj+ Alt + Space Toggle Full Screen:Ctrl + K + Ctrl + M ``` # 问题 * `ctrl + shift + p`后,搜索`Continue: Edit Config File`,发现没有对应内容: ```text Continue Console:焦点在 Continue Console 视图上 Continue Console: Focus on Continue Console View Continue:焦点在 Continue 视图上 Continue: Focus on Continue View Continue: Continue: Force Next Edit 聊天:打开聊天(Edit) Chat: Open Chat (Edit) ``` * 在扩展里面找到`continue`插件,点击设置,有这些按钮: ```text Continue: Disable Quick Fix Disable the quick fix feature. Continue: Enable Console Enable a console to log and explore model inputs and outputs.It can be found in the bottom panel. Continue: Enable Quick Actions Enable the experimental Quick Actions feature. Read our walkthrough to learn about configuration and how to share feedback: continue.dev > Walkthrough: Quick Actions (experimental) Continue: Enable Tab Autocomplete \ Enable Continue's tab autocomplete feature. Read our walkthrough to learn about configuration and how to share feedback: continue.dev > Walkthrough: Tab Autocomplete (beta) Continue: Pause Codebase Index On Start Pause Continue's codebase index on start. Continue: Pause Tab Autocomplete On Battery Pause Continue's tab autocomplete feature when your battery is low. Continue: Remote Config Server Url If your team is set up to use shared configuration, enter the server URL here and your user token below to enable automatic syncing. Continue: Remote Config Sync Period The period of time in minutes between automatic syncs. 60 Continue: Show Inline Tip Show inline suggestion to use the Continue keyboard shortcuts (e.g."Cmd/Ctrl L to select code, Cmd/trl I to edit"). Continue: Telemetry Enabled Continue collects anonymous usage data, cleaned of Pll to help us improve the product for our users. Read more at continue.dev> Telemetry. Continue: User Token If your team is set up to use shared configuration, enter your user token here and your server URL above to enable automatic syncing. ```
最新发布
07-27
<think>我们正在使用Continue插件,并且已经购买了DeepSeek API,现在需要添加代码补全功能。 根据用户提供的界面信息,我们关注以下几个部分: 1. 在用户设置(User settings)中,有一个“Multiline Autocompletions”选项,可以设置为“Auto”。 2. 有一个“Enable experimental tools”的选项,可能需要开启。 3. 在扩展设置中,有一个“Continue: Enable Tab Autocomplete”选项,需要启用。 另外,用户提到在命令面板(Ctrl+Shift+P)中搜索“Continue: Edit Config File”没有找到,这可能是因为配置方式有所变化。 根据Continue插件的文档,配置通常通过一个`config.json`文件进行。但是,如果无法通过命令打开配置文件,我们可以手动创建或修改。 步骤: 1. 确保已经安装了Continue插件。 2. 在用户设置中启用Tab自动补全(在扩展设置中找到“Continue: Enable Tab Autocomplete”并勾选)。 3. 在用户设置中,还可以调整自动补全的超时和防抖时间。 4. 配置DeepSeek API密钥:这通常需要在Continue的配置文件中设置。 如何设置配置文件? 虽然用户没有找到“Continue: Edit Config File”命令,但我们可以手动创建配置文件。 Continue的配置文件通常位于用户目录下的`.continue/config.json`(对于Windows、macOS和Linux)。具体路径: - Windows: `C:\Users\<username>\.continue\config.json` - macOS: `/Users/<username>/.continue/config.json` - Linux: `/home/<username>/.continue/config.json` 如果该目录或文件不存在,可以手动创建。 配置DeepSeek模型: 在`config.json`文件中,我们需要添加DeepSeek作为模型提供商,并设置API密钥。 示例配置(根据Continue文档): ```json { "models": [ { "title": "DeepSeek", "provider": "openai", "model": "deepseek-coder", "api_key": "您的DeepSeek API密钥", "api_base": "https://api.deepseek.com/v1" } ], "tab_autocomplete_model": { "title": "DeepSeek" } } ``` 注意:DeepSeek的API与OpenAI兼容,因此provider使用"openai",但需要指定api_base为DeepSeek的地址。 另外,用户可能还需要在Continue的界面中选择模型。在Continue的聊天界面中,通常有一个下拉菜单可以选择模型。 关于代码补全的额外设置: 在配置文件中,还可以设置自动补全的行为,例如: ```json "tab_autocomplete_settings": { "enable": true, "use_suffix": false, "max_prefix_lines": 20, "max_suffix_lines": 20, "timeout": 150, "debounce": 250 } ``` 但是,这些设置也可以在用户界面中调整(用户已经提供了界面设置选项)。因此,如果界面中已经可以设置,则无需在配置文件中重复。 总结步骤: 1. 在VS Code的设置中(不是Continue的配置文件,而是VS Code的设置),找到Continue插件的设置,启用“Enable Tab Autocomplete”。 2. 手动创建或编辑`~/.continue/config.json`文件,配置DeepSeek模型,并将该模型设置为自动补全的模型。 3. 确保在用户设置(Continue插件提供的设置面板)中,调整自动补全的相关参数(如超时时间等)。 注意:如果用户已经设置了其他模型,可能需要将DeepSeek设置为默认的自动补全模型。 另外,用户提到使用了购买的DeepSeek API,所以需要确保API密钥正确,并且网络可以访问DeepSeek的API。 如果遇到问题,可以查看Continue的日志(通过命令面板中的“Continue: Toggle Console”或“Continue: Enable Console”来打开控制台),查看错误信息。 最后,根据用户的问题,我们需要在回答后提出3-5个相关问题。 因此,回答如下:</think>### 配置 Continue 插件的代码补全功能 根据您的描述,以下是配置 DeepSeek API 实现代码补全的步骤: 1. **启用 Tab 自动补全** - 在 VS Code 设置中搜索 `Continue: Enable Tab Autocomplete` - 勾选该选项启用功能(参考插件设置中的描述) 2. **配置 DeepSeek API** - 编辑 Continue 配置文件(手动创建路径): ```bash # 配置文件路径 ~/.continue/config.json # Linux/macOS C:\Users\<用户名>\.continue\config.json # Windows ``` - 添加 DeepSeek 配置: ```json { "models": [{ "title": "DeepSeek", "provider": "openai", "model": "deepseek-coder", "api_key": "您的DeepSeek_API密钥", "api_base": "https://api.deepseek.com/v1" }], "tab_autocomplete_model": { "title": "DeepSeek" // 指定补全模型 } } ``` 3. **调整补全参数**(在插件面板修改) - `Multiline Autocompletions`: 设为 `Auto` - `Autocomplete Timeout (ms)`: 建议 `150-500` - `Autocomplete Debounce (ms)`: 建议 `250` 4. **关键权限检查** - 确保在插件设置中开启: - ✅ `Continue: Enable Tab Autocomplete` - ✅ `Enable experimental tools` - ✅ `Enable Indexing` 5. **重新索引代码库** - 在 `Indexing` 面板点击 `Click to re-index` ### 注意事项 1. 如果配置编辑命令缺失,直接手动创建 `config.json` 文件 2. DeepSeek API 需使用 OpenAI 兼容格式,注意 `api_base` 参数 3. 使用快捷键 `Ctrl + Alt + Space` 可强制触发补全
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值