How do I change shortcut keys with autohotkey? Change "lang" key to the right alt - autohotkey

Hi I have a little problem with the keyboard :
https://th.bing.com/th/id/R.1ca6faaa87fdfeadac2dccd3dcf6e79d?rik=Am9uvhyXc8DinA&riu=http%3a%2f%2fimages.samsung.com%2fis%2fimage%2fsamsung%2fde-universal-bluetooth-keyboard-bt230-ej-bt230mwegde-000061123-front-white%3f%24PD_GALLERY_JPG%24&ehk=9L5Gwm4P0CKfrx8nWx%2bnDKRKP4tTKafA2Svo2o9A%2bGY%3d&risl=&pid=ImgRaw&r=0
I want to change the "lang" button to the right alt.
My code works fine but it types a capital letter (probably by shift). Can you help me?

Related

Re-enable right-Ctrl when using Canadian Multilingual Standard keyboard for my AutoHotkey function?

I have an Autohotkey function that lets me switch between tabs with "Control + left/right" as well as closing tabs (Ctrl-down) and going into the search bar (Ctrl-up). It helps me save clicks and use the mouse less.
However, I use the Canadian Multilingual Standard keyboard to type accents (éèçà) in French for some of my classes and this keyboard DISABLES the right control key (the one right beside my keyboard buttons) which is the most convenient to use with my right hand only.
Here is a source documenting this: http://archives.miloush.net/michkap/archive/2013/04/08/10409187.html
Is there any way I can override this? I very rarely use the letter œ for because I can just use ALT + 0156 instead.
Here is the very simple code for my hotkey!
^Left::SendInput, ^{PGUP}
^Right::SendInput, ^{PGDN}
^Up::SendInput, !d
^Down::SendInput, ^w
Using SciTE4AutoHotkey tool, on my UK hardware keyboard right ctrl is detected as expected (RControl)
When I switch to French (Canada) Canadian Multilingual keyboard,
the right ctrl key is not found, also Virtual Key is different: DF
(SC means scan code and VK means virtual key)
so if you remap, it should solve the problem
~SC11D::RControl
After remapping: not found is replaced by RControl with each keypress.
Even if above remapping does not work for your case, it is a matter of finding which key corresponds to relevant scan code and then you can remap it.
Double click on your ahk script on the taskbar, and then
View > Key history and script info (Ctrl + K) by pressing key and refresh(F5) you can see respective keyboard scan codes.

Cannot insert tilde in Eclipse for C/C++

In Eclipse for C/C++ on Windows 10, I cannot insert the tilde symbol '~' which works fine in other applications.
I'm on a french keyboard, so I type Alt Gr + '~' to access it ('~' key is also the one for 'é' and '2').
I saw similar problems with curly braces or asterisks, resolved by deactivating a given shortcut, but I saw none for tildes.
I searched in the shortcuts of eclipse, but found none using '~' key with alt gr (even none with '~' key and alt or ctrl or something else).
Thank you in advance
By typing Alt+keys 0 to 9 from numeric pad to compose values from 1 to 255 or 0128 to 0255 (list of codes and corresponding characters), it's possible to enter a few characters which are not available on the keyboard:
~ : use Alt+126
` : use Alt+96
I found a solution that works for me on my Turkish Q layout, in which AltGr+ü produces tilde. It is to create a new keyboard layout and remove the dead key attribute from this key, which has the added benefit of removing this annoying "feature" of requiring two key presses to get these symbols. A detailed solution is at: https://superuser.com/a/414415/351077
Somehow the language tray icon displays the wrong language ("ENG") for the newly created layout even though the properties in the layout editor are correct, but I don't mind.

Remapping keys only one time in AutoHotkey

I use a German keyboard layout and I'm trying to move some keys around.
There is one physical key on my keyboard that has: ß, Shift+ß="?" and AltGr+ß="\", (in the US-layout is the - and Shift+-/kbd>="_" key).
I wish to move "ß" to AltGr+s, AltGr+ß="\" to "\" and disable AltGr+ß.
I tried this:
<^>!\::Return
<^>!s::Send ß
ß::Send \
This effectibly disables AltGr+ß="\" and makes ß input "\", but when I press AltGr+s it also inputs "\".
What I'm doing wrong?
I solved the problem after further trying:
ß::\
<^>!s::Send ß
<^>!ß::Return

Making a capital letter with a shift modifier press and hold option with Keyboard Maestro

I have been using Autoit for years and I have just discovered Keyboard Maestro for Mac and it's AWESOME!
Here is my problem. I need to simulate pressing the SHIFT + 1 key. Here are the steps
Press and Hold the Shift Key
Push and Release the 1 Key
Release the Shift Key
Pretty simple but for some reason it is not working. I am testing it out with the letter "a" instead of 1 because if it worked then it would create the capital letter "A".
How can I get this to produce a capital letter A by using the Shift Modifier?
Here is a screenshot of my macro
In "Simulate Keystroke", just hold down Shift+1. It will put that in as the keystroke combo, not the ! symbol.
Shift-1 example

How to make both Alt keys work same way

I have some mappings that uses Alt key on Windows XP. While they work fine with
the left Alt, they doesn't with the right Alt key.
For example, the following mapping does nothing when I press right_Alt+b,
while it display a message box when left_Alt+b is pressed.
!b::MsgBox You pressed Alt+b.
I'd like to have both Alt keys to work the same way and trigger the mapping
above.
The mapping below does works with right Alt key, but doesn't works with left
Alt key:
<^>!b::MsgBox You pressed right Alt+b.
One workaround would be duplicate all mappings that contains the alt key, but
that would significantly increase the size of some scripts. Besides, I found
that in some cases it doesn't works. Further investigation showed that the
right alt key has a strange behavior. In a script containing only the
following mapping,
^!b::MsgBox You pressed Ctrl+Alt+b.
, the message box is displayed when right_Alt+b is pressed.
I've tried to map right Alt to left Alt,
<^>!::!
or
<^>!::Send {ALT}
, but it didn't solve the problem.
You mention that you tried to map the Right-Alt to Left-Alt, but not HOW you did this. Anyway, when I use this:
RAlt::LAlt
MsgBox You pressed Alt+b. is executed when I press Right-Alt+b AND Left-Alt+b.
Can you tell how you tried to map the two Alt keys?
I write this comment as an answer because of the better formatting options.
Here is the script I used in AutoHotKey_L (1.1.09.01), should work the same in regular AutoHotKey.:
RAlt::LAlt
<^>!b::MsgBox, A You pressed right Alt+b.
^!b::MsgBox, B You pressed Ctrl+Alt+b.
Test 1: pressed Ctrl+LAlt+b. Result: MsgBox B, normal behaviour
Test 2: pressed Ctrl+RAlt+b. Result: MsgBox B, expected due to the re-mapping
Commented the ;^!b::MsgBox, B... out and tested again.
Test 3: pressed Ctrl+RAlt+b. Result: Nothing, as expected
Commented ;RAlt::LAlt out and tested again:
Test 4: pressed Ctrl+RAlt+b. Result: MsgBox A, expected since no more re-mapping.
Last but not least. There is NO difference in behaviour if I press Ctrl+RAlt+b or RAlt+Ctrl+b. One more note: I always used the LEFT Ctrl key, not the RIGHT Ctrl key.
Are you NOT getting these results?
Or are you expecting different results when you make RAlt equal to LAlt?