In open office Calc shift F4 is used to toggle absolute cell position.
My ahk script maps F4::^x
this disables the shift F4 function.
Is there a work-around?
Retain Shift F Key while mapping F Key
Re: Retain Shift F Key while mapping F Key
Thanks, the tilde sort of worked.
The shift F4 functions and the ^x (cut) also works,
but the F4 default function of open office Calc (open data sources) remains active.
What is that tilde doing? Looks like it allows multiple functions?
Any way to prevent that OOcalc default?
The shift F4 functions and the ^x (cut) also works,
but the F4 default function of open office Calc (open data sources) remains active.
What is that tilde doing? Looks like it allows multiple functions?
Any way to prevent that OOcalc default?
Re: Retain Shift F Key while mapping F Key
Hallo,
see: https://autohotkey.com/docs/Hotkeys.htm
When the hotkey fires, its key's native function will not be blocked (hidden from the system).
see: https://autohotkey.com/docs/Hotkeys.htm
When the hotkey fires, its key's native function will not be blocked (hidden from the system).
Re: Retain Shift F Key while mapping F Key
You're using a remap. Try using a hotkey instead. F4::Send ^x.
When a remap is done, it will tolerate additional modifiers being pressed, and maintain those modifiers in the output. Modifiers are Shift (+), Ctrl (^), Alt (!), and Windows Key (#). In your original code, Shift+F4 isn't disabled, but it produces Shift+Ctrl+x. If you pressed Alt+F4, you'd get Alt+Ctrl+x.
But using a Hotkey, it will only trigger if the modifier conditions match the hotkey definition. In my code, F4 only activates if you are not pressing Shift, Ctrl, Alt, or Win. If you want to be able to use those, you'd either expressly define them as +F4::Send ^+x or you'd use the * modifier which allows any modifier to be pressed and activate that hotkey. However, the * modifier does not make it behave like a Remap -- the Send command is independent of the hotkey's activation conditions. There's no special treatment to Send because you use the * modifier, such that using *F4::Send ^x results in Ctrl+X if you press F4 alone, if you press Shift+F4, if you press Ctrl+Alt+F4, etc.
If you want to achieve a hotkey that acts like a remap (this is more FYI to help you understand what's going on), there is the {Blind} "key" for Send. If you use F4::Send {Blind}^x, what that tells AHK is AHK should not interfere by releasing any of the held down keys. If Shift is in the down position, great, we're pressing Ctrl+X with it to have the net effect in any other program Shift+Ctrl+X. However, because that little code uses F4:: alone, you can nearly guarantee that Shift is not pressed. (I'd imagine it might be possible to have the F4 hotkey be activated, and then the microsecond later you press Shift, but, in reality, that's not happening.) So to make the Hotkey act like remap, you combine it with the * modifier.
Hope that helps!
When a remap is done, it will tolerate additional modifiers being pressed, and maintain those modifiers in the output. Modifiers are Shift (+), Ctrl (^), Alt (!), and Windows Key (#). In your original code, Shift+F4 isn't disabled, but it produces Shift+Ctrl+x. If you pressed Alt+F4, you'd get Alt+Ctrl+x.
But using a Hotkey, it will only trigger if the modifier conditions match the hotkey definition. In my code, F4 only activates if you are not pressing Shift, Ctrl, Alt, or Win. If you want to be able to use those, you'd either expressly define them as +F4::Send ^+x or you'd use the * modifier which allows any modifier to be pressed and activate that hotkey. However, the * modifier does not make it behave like a Remap -- the Send command is independent of the hotkey's activation conditions. There's no special treatment to Send because you use the * modifier, such that using *F4::Send ^x results in Ctrl+X if you press F4 alone, if you press Shift+F4, if you press Ctrl+Alt+F4, etc.
If you want to achieve a hotkey that acts like a remap (this is more FYI to help you understand what's going on), there is the {Blind} "key" for Send. If you use F4::Send {Blind}^x, what that tells AHK is AHK should not interfere by releasing any of the held down keys. If Shift is in the down position, great, we're pressing Ctrl+X with it to have the net effect in any other program Shift+Ctrl+X. However, because that little code uses F4:: alone, you can nearly guarantee that Shift is not pressed. (I'd imagine it might be possible to have the F4 hotkey be activated, and then the microsecond later you press Shift, but, in reality, that's not happening.) So to make the Hotkey act like remap, you combine it with the * modifier.
Hope that helps!
Re: Retain Shift F Key while mapping F Key
One solution, which Exaskryz already mentioned:
Another solution, which worked for me on LibreOffice Calc, I don't know whether it would work on OpenOffice Calc (you might have to change 'ahk_class SALFRAME'):
Code: Select all
F4::SendInput, ^x
Code: Select all
#IfWinActive, ahk_class SALFRAME
~+F4::
return
#IfWinActive
F4::^x
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA