Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Arabic (101) keyboard layout for U.S. (QWERTY) keyboards.
- ;
- ;Version 1.0.1. For AutoHotkey v1 Unicode version only.
- ;https://pastebin.com/u/jcunews
- ;https://www.reddit.com/user/jcunews1
- ;
- ;Layout image: https://upload.wikimedia.org/wikipedia/commons/a/af/KB_Arabic.svg
- ;
- ;This script is for users whose system not yet have Arabic keyboard layout,
- ;and the users do not have access to add built in keyboard layouts.
- ;Use the ScrollLock key activate/deactivate (follows the ScrollLock LED).
- #persistent
- if (!a_isunicode) {
- msgbox This script requires Unicode version of AutoHotkey v1.
- exitapp
- }
- map:= {"'": ["0637", "0651"]
- , ",": ["0648", ","]
- , ".": ["0632", "."]
- , "/": ["0638", "061F"]
- , ";": ["0643", ":"]
- , "[": ["062C", "<"]
- , "\": ["0630", "|"]
- , "]": ["062F", ">"]
- , "``": ["0630", "0651"]
- , "A": ["0634", "0650"]
- , "B": ["06440627", "06440622"]
- , "C": ["0624", "0650"]
- , "D": ["064A", "]"]
- , "E": ["062B", "064F"]
- , "F": ["0628", "["]
- , "G": ["0644", "06440623"]
- , "H": ["0627", "0623"]
- , "I": ["0647", "00F7"]
- , "J": ["062A", "0640"]
- , "K": ["0646", "060C"]
- , "L": ["0645", "/"]
- , "M": ["0629", "2019"]
- , "N": ["0649", "0622"]
- , "O": ["062E", "00D7"]
- , "P": ["062D", "061B"]
- , "Q": ["0636", "064E"]
- , "R": ["0642", "064C"]
- , "S": ["0633", "064D"]
- , "T": ["0641", "06440625"]
- , "U": ["0639", "2018"]
- , "V": ["0631", "064D"]
- , "W": ["0635", "064B"]
- , "X": ["0621", "0652"]
- , "Y": ["063A", "0625"]
- , "Z": ["0626", "~"]}
- for k, v in map {
- loop 2 {
- if (strlen(v[a_index]) == 4) {
- v[a_index]:= chr("0x" v[a_index])
- } else if (strlen(v[a_index]) == 8) {
- v[a_index]:= chr("0x" substr(v[a_index], 1, 4)) chr("0x" substr(v[a_index], 5))
- }
- }
- }
- if (getkeystate("scrolllock", "t"))
- check()
- return
- check() {
- global map
- if (getkeystate("scrolllock", "t")) {
- for k, v in map {
- hotkey, %k%, handler
- hotkey, +%k%, handler
- }
- } else {
- for k, v in map {
- hotkey, %k%, off
- hotkey, +%k%, off
- }
- }
- }
- ~scrolllock::
- keywait scrolllock
- check()
- return
- handler:
- i:= getkeystate("capslock", "t") ^ (substr(a_thishotkey, 1, 1) == "+")
- send % map[substr(a_thishotkey, 0)][i + 1]
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement