Skip to content

Commit a72961e

Browse files
committed
use alt trick improve reliability previous commit
1 parent 252f5ed commit a72961e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,9 +2223,12 @@ unsafe extern "fastcall" fn room_form(room_id: usize) -> u32 {
22232223
#[link(name = "user32")]
22242224
unsafe extern "system" {
22252225
fn GetActiveWindow() -> HANDLE;
2226+
fn keybd_event(bVK: u8, bScan: u8, dwFlags: u32, dwExtraInfo: isize);
22262227
fn SetForegroundWindow(hwnd: HANDLE) -> BOOL;
22272228
}
2229+
keybd_event(0xA5,0,0,0); //send alt keycode to trick windows into allowing the jump
22282230
SetForegroundWindow(GetActiveWindow());
2231+
keybd_event(0xA5,0,0x02,0); //clear alt
22292232

22302233
if !matches!(result.map(|s| s.success()), Ok(true)) {
22312234
let message = UStr::new(format!(

0 commit comments

Comments
 (0)