[request] Flashing Keyboard LED's when message received |
Author: |
Message: |
MGrove03
New Member
Posts: 10
Joined: Jun 2006
|
RE: [request] Flashing Keyboard LED's when message received
for any1 who wants it here is the code for making it beep aswell as flash
code: //WML Flash 1.0 for MPL! (Smilie) by ivan300@yahoo.com
// slightly modified by djcarre@gmail.com and mgrove03@gmail.com
var VK_num = 144
var VK_scroll = 145
var VK_caps = 20
var KEYEVENTF_KEYUP = '&H2'
var count = 0
function OnEvent_Initialize(bMessengerStart){
}
function OnEvent_Uninitialize(bMessengerExit){
}
//when a chat window is created it starts a timer
function OnEvent_ChatWndCreated(){
MsgPlus.AddTimer('check', 200);
}
function OnEvent_ChatWndReceiveMessage(Wnd, Origin,Message,MessageKind){
if(Origin != Messenger.MyName)
MsgPlus.AddTimer('check',200);
return Message;
}
//when the chat window is closed it stops the timers and turns the light off
function OnEvent_ChatWndDestroyed(){
MsgPlus.CancelTimer('check');
MsgPlus.CancelTimer('check2');
}
//stops the blining when you type into the convo
//make sure to change VK_scroll accordingly if youre using a different led
function OnEvent_ChatWndEditKeyDown(Wnd, key){
if(key != VK_scroll){
MsgPlus.CancelTimer('check');
MsgPlus.CancelTimer('check2');
}
}
//to change which light you want to blink change the
// Vk_scroll to VK_num for num lock or VK_caps for caps lock
//this turns the light off and on depending on the timers
function OnEvent_Timer(sTimerId){
if(sTimerId == 'check'){
Debug.Trace('check');
Interop.Call('user32', 'keybd_event', VK_scroll, 0, 0, 0);
Interop.Call('user32', 'keybd_event', VK_scroll, 0, 2, 0);
//Makes the computer beep when a message is received
Interop.Call('kernel32', 'Beep', 1000 , 50);
MsgPlus.AddTimer('check2', 100);
}
if(sTimerId == 'check2'){
Debug.Trace('check2')
Interop.Call('user32', 'keybd_event', VK_scroll, 0, 0, 0);
Interop.Call('user32', 'keybd_event', VK_scroll, 0, 2, 0);
//Makes the computer beep when a message is received
Interop.Call('kernel32', 'Beep', 1000 , 50);
MsgPlus.AddTimer('check', 100);
}
}
This post was edited on 06-28-2006 at 06:54 PM by MGrove03.
|
|
06-28-2006 04:50 PM |
|
|
Silentdragon
Full Member
if(life==null && wrists) EmoAlert();
Posts: 148 Reputation: 2
34 / / –
Joined: Jun 2006
|
RE: [request] Flashing Keyboard LED's when message received
code: //WML Flash 1.0 for MPL! (Smilie) by ivan300@yahoo.com
// slightly modified by djcarre@gmail.com, silentdragon@gmail.com, and mgrove03@gmail.com
var selectiveBlink = 0
var beep = 0
var keep_caps = 0
var VK_num = 144
var VK_scroll = 145
var VK_caps = 20
var KEYEVENTF_KEYUP = 0x02
var count = 0
function OnEvent_Initialize(bMessengerStart){
}
function OnEvent_Uninitialize(bMessengerExit){
}
//when a chat window is created it starts a timer
function OnEvent_ChatWndCreated(){
MsgPlus.AddTimer('check', 200);
}
function OnEvent_ChatWndReceiveMessage(Wnd, Origin,Message,MessageKind){
if(selectiveBlink == 1) {
var contacts = new Enumerator(Wnd.Contacts);
for (; !contacts.atEnd(); contacts.moveNext())
{
var contact = contacts.item();
switch(contact.Email){
case 'someemail@hotmail.com' :
case 'someemail2@hotmail.com' :
MsgPlus.AddTimer('check',200);
count++;
break;
}
if(count) break;
}
count = 0;
} else
if(Origin != Messenger.MyName)
MsgPlus.AddTimer('check',200);
return Message;
}
//when the chat window is closed it stops the timers and turns the light off
function OnEvent_ChatWndDestroyed(){
MsgPlus.CancelTimer('check');
MsgPlus.CancelTimer('check2');
}
//stops the blining when you type into the convo
//make sure to change VK_scroll accordingly if youre using a different led
function OnEvent_ChatWndEditKeyDown(Wnd, key){
if(key != VK_scroll && key != VK_caps){
MsgPlus.CancelTimer('check');
MsgPlus.CancelTimer('check2');
}
}
//to change which light you want to blink change the
// Vk_scroll to VK_num for num lock or VK_caps for caps lock
//this turns the light off and on depending on the timers
function OnEvent_Timer(sTimerId){
if(sTimerId == 'check'){
//Debug.Trace('check');
Interop.Call('user32', 'keybd_event', VK_scroll, 0, 0, 0);
Interop.Call('user32', 'keybd_event', VK_scroll, 0, 2, 0);
if(beep) Interop.Call('kernel32', 'Beep', 1000 , 50);
if(!Interop.Call('user32', 'GetKeyState', VK_caps))
MsgPlus.AddTimer('check2', 100);
else if(!keep_caps) {
Interop.Call('user32', 'keybd_event', VK_caps, 0, KEYEVENTF_KEYUP, 0);
Interop.Call('user32', 'keybd_event', VK_caps, 0, 0, 0);
}
}
if(sTimerId == 'check2'){
//Debug.Trace('check2')
Interop.Call('user32', 'keybd_event', VK_scroll, 0, 0, 0);
Interop.Call('user32', 'keybd_event', VK_scroll, 0, KEYEVENTF_KEYUP, 0);
if(beep) Interop.Call('kernel32', 'Beep', 1000 , 50);
if(!Interop.Call('user32', 'GetKeyState', VK_caps))
MsgPlus.AddTimer('check', 100);
else if(!keep_caps) {
Interop.Call('user32', 'keybd_event', VK_caps, 0, KEYEVENTF_KEYUP, 0);
Interop.Call('user32', 'keybd_event', VK_caps, 0, 0, 0);
}
}
}
Selective emails should work now, keep caps on is in option, but the current method won't work because caps are on. To switch that remove the ! from !Interop.Call('user32', 'GetKeyState', VK_caps) both times. Has an option to beep too.
|
|
06-28-2006 07:49 PM |
|
|
DarkRaider
Junior Member
Posts: 61
39 / / –
Joined: Mar 2005
|
O.P. RE: [request] Flashing Keyboard LED's when message received
ok guys, got the first version with a small configuration window..
give me your comments and i'll see what i can change if needed
Download here (Right click -> save as)
Functions for this version:
- Configuration lets the user choose which LEDs have to flash
- Included the beep, but dunno if it works.. couldn't test it here on my laptop (but if the code in the previous post work, then this should work )
- Added the possibility to disable the flashing leds when your messenger is locked.. (haven't tested that either, but it should work)
- The ability to switch of the script in the contactlist Plus! Menu as requested
This post was edited on 06-28-2006 at 08:44 PM by DarkRaider.
|
|
06-28-2006 08:39 PM |
|
|
Dark_Angel_Pt
Junior Member
Posts: 25
41 / / –
Joined: Jun 2006
|
RE: [request] Flashing Keyboard LED's when message received
I get an error when i'm installing the script and it doesn't finish the instalation
If you try and don't succeed, cheat. Repeat until caught. Then lie.
|
|
06-28-2006 08:46 PM |
|
|
Bmw1000c
Junior Member
yay!
Posts: 45
44 / / –
Joined: May 2004
|
RE: [request] Flashing Keyboard LED's when message received
---------------------------
Messenger Plus! Live
---------------------------
An error occurred while importing the script files.
---------------------------
OK
---------------------------
|
|
06-28-2006 08:46 PM |
|
|
DarkRaider
Junior Member
Posts: 61
39 / / –
Joined: Mar 2005
|
O.P. RE: [request] Flashing Keyboard LED's when message received
i'll try to fix it.. for now, just rename it to .zip
|
|
06-28-2006 08:48 PM |
|
|
Dark_Angel_Pt
Junior Member
Posts: 25
41 / / –
Joined: Jun 2006
|
RE: RE: [request] Flashing Keyboard LED's when message received
quote: Originally posted by DarkRaider
i'll try to fix it.. for now, just rename it to .zip
What do i do with the .zip file?
If you try and don't succeed, cheat. Repeat until caught. Then lie.
|
|
06-28-2006 08:51 PM |
|
|
DarkRaider
Junior Member
Posts: 61
39 / / –
Joined: Mar 2005
|
O.P. RE: [request] Flashing Keyboard LED's when message received
ok, i put a better version on my webspace (same link as posted above), you can now install it.
it still gives an error here, but eventhough it gives an error, the files are in the script directory
i'll try to find a solution to this
This post was edited on 06-28-2006 at 08:56 PM by DarkRaider.
|
|
06-28-2006 08:54 PM |
|
|
Dark_Angel_Pt
Junior Member
Posts: 25
41 / / –
Joined: Jun 2006
|
RE: RE: [request] Flashing Keyboard LED's when message received
quote: Originally posted by DarkRaider
ok, i put a better version on my webspace (same link as posted above), you can now install it.
it still gives an error here, but eventhough it gives an error, the files are in the script directory
i'll try to find a solution to this
I have the files in the script directory but it's not in the plus options.
If you try and don't succeed, cheat. Repeat until caught. Then lie.
|
|
06-28-2006 09:09 PM |
|
|
DarkRaider
Junior Member
Posts: 61
39 / / –
Joined: Mar 2005
|
O.P. RE: [request] Flashing Keyboard LED's when message received
ok, found the bug.. should work fine now
here is the link again:
Download here (Right click -> save as)
|
|
06-28-2006 09:13 PM |
|
|
Pages: (10):
« First
«
1
2
3
4
[ 5 ]
6
7
8
9
»
Last »
|
|
|