Jump to content

Remap CapsLock to Ctrl possible? So Capslock works exactly like Ctrl.


Recommended Posts

Posted (edited)

Try this simple solution :

#include <WinAPISys.au3>
#include <WinAPIvkeysConstants.au3>

HotKeySet("^!{END}", _Exit) ; Ctrl-Alt-End to exit

Local $aKeyMap = StringSplit("axcvz", "", 0)  ; keys mapped to Ctrl when CapsLock is on
Local $iSet = False

While True
  Sleep(20)
  If _WinAPI_GetKeyState($VK_CAPITAL) Then
    If $iSet Then ContinueLoop
    For $i = 1 to $aKeyMap[0]
      HotKeySet($aKeyMap[$i], _SendCtrl)
    Next
  Else
    If Not $iSet Then ContinueLoop
    For $i = 1 to $aKeyMap[0]
      HotKeySet($aKeyMap[$i])
    Next
  EndIf
  $iSet = Not $iSet
WEnd

Func _SendCtrl()
  Send("^" & @HotKeyPressed)
EndFunc

Func _Exit()
  Exit
EndFunc

 

Edited by Nine
Link to post
Share on other sites
3 hours ago, gyaani said:

Ctrl+c and Ctrl+v

You can use Ctrl+Ins and Shift+Ins instead.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to post
Share on other sites
  • Moderators

Or use this as an opportunity to define the process/steps that are causing you to copy and paste so often, and automate them. Kill two birds with one stone, without having to re-engineer your keyboard keys.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...