| View previous topic :: View next topic |
| Author |
Message |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Thu Mar 30, 2006 2:07 pm Post subject: Send Ctrl+C will browse back in Opera |
|
|
Hi,
this simple script let opera to go back in history (like Alt+Left). What's the problem? I've tried SendEvent, SendInput and SendPlay, always the same result.
Edit: The problem is, that I only want to copy the selected text. _________________ Tekl |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Thu Mar 30, 2006 2:15 pm Post subject: |
|
|
I am not sure this belongs to Bug reports, unless you prove it is a problem with AHK...
I don't have Opera installed right now, so I don't know where the problem is, sorry.
Just to be complete, you could try remapping: #y::^c
Is this hotkey alone? It may be an interference with some of your other hotkeys. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Mar 30, 2006 2:34 pm Post subject: |
|
|
Hi,
without Send, theres no problem, but I need Send, ^c inside a script. There is no other script running.
I'm using the latest beta of Opera from: http://my.opera.com/desktopteam/
Also AutoHotkey 1.0.43.0.02 does not fix this. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10464
|
Posted: Thu Mar 30, 2006 5:04 pm Post subject: |
|
|
You could try a key-delay:
SetKeyDelay -1, 10
SendEvent ^c
If that doesn't help, can you give more details about why this might be a bug? For example, do older AHK versions work properly for this hotkey but not newer ones? |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Mon Apr 03, 2006 8:31 am Post subject: |
|
|
Hi Chris,
I tried it with 1.0.35.16. There's also the same problem. Very strange. It seems to be an opera-problem. I thought it to be an AHK-problem, because Ctrl+C by hand does not produce this bug.
In the old AHK-Version it's possible to get a workaround with SetKeyDelay, 10, 10 in 1.0.43.02 even SetKeyDelay, 20,20 does not help. I tried it with Send and SendEvent. _________________ Tekl |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Mon Apr 03, 2006 9:05 am Post subject: |
|
|
Possible workarounds: in some applications, the old Windows 3.1 shortcut Ctrl+Insert still does a copy. You may try this.
For reference, Shift+Insert pastes and Shift+Delete cuts.
You can also try and use the menus, if they are accessible. Try SendMessage and WinMenuSelectItem. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Mon Apr 03, 2006 9:51 am Post subject: |
|
|
Thanks PhiLho,
but there's the same problem. It seems that Opera sees a Alt+Left. _________________ Tekl |
|
| Back to top |
|
 |
evl
Joined: 24 Aug 2005 Posts: 1238
|
Posted: Mon Apr 03, 2006 1:00 pm Post subject: |
|
|
| Have you looked at the key history to see what key events are being detected? |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Mon Apr 03, 2006 1:07 pm Post subject: |
|
|
There's nothing curious ...
| Code: |
A2 01D i d 2.78 CTRL Post a reply - Opera
5B 15B i u 0.00 LEFT WINDOWS
43 02E i d 0.00 C
43 02E i u 0.00 C
5B 15B i d 0.00 LEFT WINDOWS
A2 01D i u 0.00 CTRL
|
_________________ Tekl |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Mon Apr 03, 2006 1:13 pm Post subject: |
|
|
STOP ...
I've found the problem. Opera browses back with CTRL+WIN.
Sorry for that. It seems to be new in Opera.
Is there a reliable way to reset all modifier-keys before sending? I thought AHK would do it by itself and only {Blind} will leave the modifiers untouched.
Rember: I'm sending Ctrl+C with Win+Y, so Win is held down while Ctrl+C. _________________ Tekl |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10464
|
Posted: Mon Apr 03, 2006 3:59 pm Post subject: |
|
|
AHK releases LWin only after pressing down Ctrl to avoid unwanted appearances of the Start Menu. Since changes to this complex area might break existing scripts, I'd prefer not to change the program to work around this unusual Opera hotkey.
To solve this, try:
#y::Send {LWin up}{RWin up}^c
You could also use GetKeyState to selectively release only one of the Win keys.
The above might still be a problem because the tail end of key history shows:
5B 15B i d 0.01 Left Windows
A2 01D i u 0.00 Ctrl
So if the above triggers the Opera hotkey, you might have to resort to something more severe like:
| Code: | | #y::Send {Blind}{LWin up}{RWin up}^c | But this has the disadvantage of not restoring your LWin/RWin key to the down position after the Send, which in turn prevents you from pressing Win+Y again unless you first release Win. |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Mon Apr 03, 2006 5:43 pm Post subject: |
|
|
Hi,
thanks for the investigation. It seems that only the {Blind} way works well. So I decided to use a function in all my scripts. I'm just testing if it's reliable enough to reset the down-state after ^c.
| Code: | func_GetSelection(copyAsText=1)
{
theModifiers = LCtrl,RCtrl,LWin,RWin,LAlt,RAlt,LShift,RShift,LButton,MButton,RButton
resetModifiers =
Loop, Parse, theModifiers, `,
{
If (GetKeyState(A_LoopField))
{
resetModifiers = %resetModifiers%{%A_LoopField% up}
restoreModifiers = {%A_LoopField% down}%restoreModifiers%
}
}
SavedClipboard := ClipboardAll
Clipboard =
Send, {Blind}%resetModifiers%^c%restoreModifiers%
ClipWait, 0.5
If copyAsText = 1
Clip = %Clipboard%
Else
Clip = %ClipboardAll%
Clipboard := SavedClipboard
return %Clip%
}
|
_________________ Tekl |
|
| Back to top |
|
 |
_anonymous_ Guest
|
Posted: Sat Jan 26, 2008 2:00 pm Post subject: another solution |
|
|
| or you can find here a work-around |
|
| Back to top |
|
 |
|