Skip to content

Instantly share code, notes, and snippets.

View nocaoper's full-sized avatar
😄
happy

Yu-Chiang Hsu nocaoper

😄
happy
  • Canada
View GitHub Profile
@ulic-youthlic
ulic-youthlic / capslock.ahk
Last active June 17, 2024 01:08
map my <CapsLock> to <Esc>(alone) and <C-x>(with other key) using AutoHotKey v2.0.
#Requires AutoHotkey v2
; Install the keyboard hook to capture the real key state of the keyboard
InstallKeybdHook(true)
; Disable the CapsLock key
SetCapsLockState("alwaysoff")
; Send esc key when Capslock is pressed as default
g_DoNotAbortSendEsc := true
$*Capslock::{ ; Capture CapsLock key press
global g_DoNotAbortSendEsc ; use global variable g_DoNotAbortSendEsc
@kuanyui
kuanyui / resize-frame.el
Last active January 25, 2024 05:33
resize-frame.el --- A minor mode to resize frames easily.
;;; resize-frame.el --- A minor mode to resize frames easily. -*- lexical-binding: t; -*-
;; Copyright (C) 2014 kuanyui
;; Author: kuanyui <azazabc123@gmail.com>
;; Keywords: frames, tools, convenience
;; License: WTFPL 1.0
;;; Commentary:
@sedm0784
sedm0784 / CapsLockCtrlEscape.ahk
Last active June 16, 2024 04:27
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}