Jump to content

Recommended Posts

Posted

So I recently bought a Logitech G110, and it has this nice little scroll wheel for volume. I was wondering if it would be possible to remap its function to function as a scrollwheel instead as it would be more useful for me. Though, I'm not very experienced in AutoIT, so I don't really know where to start. Any ideas? I tried this so far but it didn't work:

HotKeySet("{VOLUME_UP}", "scrollUp")
Func scrollUp()
    MouseWheel("up",10)
    HotKeySet("{VOLUME_UP}", "scrollUp")
EndFunc

I checked what it sends with some C# code I found, and it seems like it sends VolumeUp and VolumeDown, http://pixomania.net/pics/Screenshot-2011-08-05_20.50.04.png http://pixomania.net/pics/Screenshot-2011-08-05_20.50.46.png

Posted

  • The script exits as there's nothing that keeps it alive
  • Why are you re-setting the hotkey like that? You never unset it so it looks kinda pointless
  • After adding the loop it works just fine

HotKeySet("{VOLUME_UP}", "scrollUp")

While 1
    Sleep(100)
WEnd

Func scrollUp()
    ConsoleWrite(Random() & @LF)
    MouseWheel("up", 10)
EndFunc
Posted

  • The script exits as there's nothing that keeps it alive
  • Why are you re-setting the hotkey like that? You never unset it so it looks kinda pointless
  • After adding the loop it works just fine

HotKeySet("{VOLUME_UP}", "scrollUp")

While 1
    Sleep(100)
WEnd

Func scrollUp()
    ConsoleWrite(Random() & @LF)
    MouseWheel("up", 10)
EndFunc

Ahh, thank you. That works just fine :). As I said I'm not very experienced with AutoIT, it just happens once in a while (about 4 or so months apart) that I find myself doing something, so I often forget what I managed to learn. I did it in that way because I saw it done like that somewhere but I can't remember where and if it really was that way :mellow:

Anyway, do you mind if I include the finished script in a blogpost on my blog? I'll include full credits to you (And maybe a link to your site if you got any, if you provide one?) in the blogpost :)

Posted

Anyway, do you mind if I include the finished script in a blogpost on my blog? I'll include full credits to you (And maybe a link to your site if you got any, if you provide one?) in the blogpost :)

You do whatever you want with it, there's no licence in it it. And besides, this isn't the finished script, is it? Shouldn't there be a VolumeDown, remove the ConsoleWrite (as it serves no purpose other than testing if the HotKey fires). I would also disable the auto-pause when the tray is clicked, I find that annoying (Opt("TrayAutoPause", 0)). If you do that, it would be mostly your script :)

My website is crap but you can link to my Facebook I guess if you want.

:mellow:

Posted

You do whatever you want with it, there's no licence in it it. And besides, this isn't the finished script, is it? Shouldn't there be a VolumeDown, remove the ConsoleWrite (as it serves no purpose other than testing if the HotKey fires). I would also disable the auto-pause when the tray is clicked, I find that annoying (Opt("TrayAutoPause", 0)). If you do that, it would be mostly your script :)

My website is crap but you can link to my Facebook I guess if you want.

:mellow:

Yeah I already fixed those functions too :). Thanks for the help once again :)

Posted

Do you know how I can check if scrollock is active or not? Because I thought of having volume functionality when it's active, and scroll functionality when it isn't. I tried the code I found in this post: but it seems like it returns a random number (different number each time) starting with 1 when it's active, and another different number each time starting with 8 if it's inactive. I'm unsure if the 1 and 8 is constant values, so I don't know if I can assume scroll lock is off if the number starts with 8?

Posted (edited)

I get some weird numbers too (but only on on x64 :mellow: ). The problem is the return-value on the DllCall() is wrong.

If you look at GetKeyState on MSDN, the return value is a SHORT, which as you can see HERE is a 16-bit integer.

Now look at DllCall() in the AutoIt helpfile, the code uses "long" which is a 32 bit integer, so you pick up some trash.

So to fix it:

Global Const $VK_NUMLOCK = 0x90
Global Const $VK_SCROLL = 0x91
Global Const $VK_CAPITAL = 0x14


MsgBox(0,"Keys","NumLock: " & _GetNumLock() & @LF & _
"Scroll Lock: " & _GetScrollLock() & @LF & _
"Caps Lock: " & _GetCapsLock())

Func _GetNumLock()
    Local $ret
    $ret = DllCall("user32.dll","short","GetKeyState","long",$VK_NUMLOCK)
    Return $ret[0]
EndFunc

Func _GetScrollLock()
    Local $ret
    $ret = DllCall("user32.dll","short","GetKeyState","long",$VK_SCROLL)
    Return $ret[0]
EndFunc

Func _GetCapsLock()
    Local $ret
    $ret = DllCall("user32.dll","short","GetKeyState","long",$VK_CAPITAL)
    Return $ret[0]
EndFunc
Edited by AdmiralAlkex
Posted

I get some weird numbers too (but only on on x64 :mellow: ). The problem is the return-value on the DllCall() is wrong.

If you look at GetKeyState on MSDN, the return value is a SHORT, which as you can see HERE is a 16-bit integer.

Now look at DllCall() in the AutoIt helpfile, the code uses "long" which is a 32 bit integer, so you pick up some trash.

So to fix it:

Global Const $VK_NUMLOCK = 0x90
Global Const $VK_SCROLL = 0x91
Global Const $VK_CAPITAL = 0x14


MsgBox(0,"Keys","NumLock: " & _GetNumLock() & @LF & _
"Scroll Lock: " & _GetScrollLock() & @LF & _
"Caps Lock: " & _GetCapsLock())

Func _GetNumLock()
    Local $ret
    $ret = DllCall("user32.dll","short","GetKeyState","long",$VK_NUMLOCK)
    Return $ret[0]
EndFunc

Func _GetScrollLock()
    Local $ret
    $ret = DllCall("user32.dll","short","GetKeyState","long",$VK_SCROLL)
    Return $ret[0]
EndFunc

Func _GetCapsLock()
    Local $ret
    $ret = DllCall("user32.dll","short","GetKeyState","long",$VK_CAPITAL)
    Return $ret[0]
EndFunc

Tack så mycket :)

Worked perfectly :). Implementing and adding it to my blog, I'll add a link to it in this post later :)

  • 6 months later...
Posted

Раздумье давило мне ногой на горло, руки озябли, и казалось, вот-вот должны были отвалиться. Я присела на близ стоящую скамью и погрузилась от усталости в лёгкий сон.

а то простынешь или ещё чего хуже. Да ты уже холодная как лягушка.

, будто хотела разжечь между ними огонь. Потом сняла плащ я наблюдала за тем, как она, повернувшись ко мне боком докуривала Её короткие, тёмные и растрепанные до плеч волосы, Оттащил тело в заранее присмотренный мною подвал и там, не спеша,начал движение. с ребенком ездили отдыхать на юг, так получилось,а вот в мою попку одна из "крепёжек" входить никак не хотела. я первый раз купалась голой (не считая детства). <a href="http://elite-prostitute.posterous.com/">проститутки скачать бесплатно</a>

лет по 20, все коротко стрижены, красивые, одеты были только в шорты. <a href="http://total-prostitutki.posterous.com/"> проститутки эскорт</a>

v закрыв грудь и киску руками, но парень с вещами уже скрылся, а оставшиеся вели себя как животные, тыкали на

<a href="http://super-soski-rossii.posterous.com/">путана cz</a>

или где-то, где их могли спрятать я могла вечно, да ещё и на глазах парней, вернуться домой в таком виде, это вообще нереально,

я не знала, что делать, и подумав,

<a href="http://lu4wie-soski-tyt.posterous.com">шлюхи инцест</a>

- покажи, что умеешь, шлюшка.

<a href="http://sossalki-zdes-ru.posterous.com">проститутки индивидуалки дешево</a>

- о! да посмотри на нашу скромницу,

мне это все больше и больше начинало нравиться. тут высокий, которому я делала минет,

я примерила тот страпон на ремешках, к которому крепились вагинальные и анальные вставки, они также вошли без проблем и каких-либо неприятных ощущений. ненароком я включила видео с сайтов мужа. Он поначалу сделал вид, что видит это впервые, но я продолжила свою игру.

- Объясни мне дорогой, тебя это возбуждает?

- Ну, как бы немного да...

- То есть я тебя не возбуждаю, а вот это всё возбуждает!?

- Ну что ты дорогая, ты конечно возбуждаешь! Тем более что мы так давно не виделись, иди ко мне!

- Ну уж нет! Сегодня ты будешь делать то, что я скажу! Или доступ к моему телу будет закрыт надолго!

- Да дорогая, как скажешь, так и будет!

Странно как быстро и легко он согласился, похоже о чём-то догадался, но это уже и не важно.

<a href="http://otpadnie-wluhi-ru.posterous.com">университетские шлюхи</a>

Я подошла к столику на котором рядком лежали все причиндалы, не зная с чего начинать, я взяла ту самую ёлочку, выдавила на неё немного смазки, размазала по всей длине и прислонила к анусу мужа. Немного надавив, кончик без труда

капельки смазки. Когда ёлочка вошла наполовину, муж застонал.

Она опустила меня на колени перед собой и притянула моё лицо к своим трусикам... они были влажные и очень горячие... "целуй" сказала она, "целуй и лижи", я поцеловал влажную ткань трусиков и немножко лизнул их...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...