AutoHotkey Community

It is currently May 26th, 2012, 8:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: June 19th, 2008, 2:16 am 
Offline

Joined: June 19th, 2008, 1:23 am
Posts: 7
My laptop has a "Fn" key for special functions. The command to lock the computer is Fn+F2, which activates a special software menu that has "Lock Computer" highlighted with the cursor over it. I just want to be able to have a Rocketdock button to lock my computer, so I don't want to map this to a hotkey. This is what I have, and it does nothing:
Code:
SendInput {vkFFsc163 down}{F2}{vkFFsc163 up}
Sleep, 1000
MouseClick, left

I've already confirmed that FF 163 is the code for the Fn button via a short test, but on activation of the script it just waits 1000ms and clicks another time. The menu never comes up. Using the keyboard hook, AHK shows that the proper keys were pressed but nothing happens. I also tried having it press the special invisible "lock" button that the keyboard hook reported, but that did not work either. I tried letting it hold the key down for a bit but that didn't help. Is there anything I'm doing wrong?

Current iteration:
Code:
SendInput {vkA0sc02A down} ;the key code for Fn+F2 (lock)
Sleep, 200
SendInput {vkA0sc02A up}
;Sleep, 1000
;MouseClick, left


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 2:36 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
Have you tried both in conjunction?

Code:
Send {vkFFsc163 down}{vkA0sc02A down}{vkA0sc02A up}{vkFFsc163 up}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 3:07 am 
Offline

Joined: June 19th, 2008, 1:23 am
Posts: 7
No dice, even when adding an {F2} in the middle. When I run SendInput {vkA0sc02A} it looks exactly like what happens when I press Fn+F2 in the hook log, but it does nothing.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 3:33 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
Probably uses a lower level hook, just like how
Code:
Send, ^!{Delete}

Won't open the task manager.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 3:40 am 
Offline

Joined: June 19th, 2008, 1:23 am
Posts: 7
Probably; that's kinda disappointing. Thanks for your help, though.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 19th, 2008, 5:43 am 
Offline

Joined: June 18th, 2008, 8:33 pm
Posts: 20
dAh wrote:
My laptop has a "Fn" key for special functions. The command to lock the computer is Fn+F2, which activates a special software menu that has "Lock Computer" highlighted with the cursor over it.
Hi, Thinkpad User. T42 user here.

Because the T42 does not have a Windows key, I have replaced some of the functionality of the Alt button with the windows button, but not all. So, Alt-L, Alt-D, Alt-R all act like their Win-* counterparts, while Alt-N still is Alt-N.

I used to use nircmd.exe (stored in Program Files for me, but where it's stored is irrelevant) to lock my workstation by calling run, nircmd.exe "lock ws". However I found that I could simply do DllCall("LockWorkStation") and have the same effect. I have not found out a better way to do Show Desktop (Win+D). I think you can call shell32.dll\ToggleDesktop, but I have not gotten that to work. I have it simply send #D to show the desktop.

If you're interested in the rest of the keys, let me know and I'll post my script.

_________________
ttrickyy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 9:47 pm 
Offline

Joined: June 19th, 2008, 1:23 am
Posts: 7
I did a quick search for locking the computer through a batch file (my second option), and found a Sysinternals exe pack to extend functionality of certain commands:
http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx
(Copy/paste exe pack to system32 folder)
"psshutdown -l" locks the computer.

I just got my T61p a month or two ago, and they come with Windows keys now. :D That's why I love AHK, because it doesn't matter either way.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 10:00 pm 
Offline

Joined: June 18th, 2008, 8:33 pm
Posts: 20
dAh wrote:
I just got my T61p a month or two ago, and they come with Windows keys now. :D That's why I love AHK, because it doesn't matter either way.

A lot of my friends got T61p's recently. Personally I saved $1000 by buying a T42 off of ebay, because that's all I need. The new series coming out in September will be good though.

Back on topic though, did you get the script that you wanted working correctly?

_________________
ttrickyy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 3:40 am 
Offline

Joined: June 19th, 2008, 1:23 am
Posts: 7
Yeah, I ended up using a batch file with the aforementioned command prompt supplement.

The reason I got a T61p was to have my only computer be a laptop for the time being (i.e. college), since it'll just be more convenient that way. It's done well so far; it runs Solidworks, Photoshop, games, etc. very well. I love the direction Lenovo is taking the ThinkPad brand in terms of style; my dad's workplace bought him an X300 as his new laptop so that they could "see what the SDD fuss is all about," and it's the coolest laptop I've ever seen.
/offtopic


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 4:17 am 
Offline

Joined: June 18th, 2008, 8:33 pm
Posts: 20
dAh wrote:
Yeah, I ended up using a batch file with the aforementioned command prompt supplement.

The reason I got a T61p was to have my only computer be a laptop for the time being (i.e. college), since it'll just be more convenient that way. It's done well so far; it runs Solidworks, Photoshop, games, etc. very well. I love the direction Lenovo is taking the ThinkPad brand in terms of style; my dad's workplace bought him an X300 as his new laptop so that they could "see what the SDD fuss is all about," and it's the coolest laptop I've ever seen.
/offtopic

I WANT TO WORK THERE.

Your plan sounds a lot like my plan. Now the only problem is money.

What resolution do you run? I've seen 1920, which seems a little dim, and 1680, which is brighter, but still not to the level I used to have on my Dell E1505...

_________________
ttrickyy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 3:11 pm 
Offline

Joined: June 19th, 2008, 1:23 am
Posts: 7
1920 ftw. It's not really that dim to me, though using it in direct sunlight is a pain, especially with any smudges on the screen. The high resolution/screen real estate more than makes up for this; the pixel density is 148ppi, the highest of any laptop/computer LCD on the market, especially in the 15.4" form-factor. (Btw, I spent a lot of time shopping for this thing, and for a powerful 15.4" laptop the T61p can't be beat. 17" is needlessly huge.) You will get better framerates with 1680 though...

The X300 screen is BRIGHT. The highest setting is easily twice as powerful as the previous, and you could use it as a lamp if you wanted, or even a powerful flashlight.

If I were to purchase another laptop in the next few years, I would wait for the X200, a 12" X300. It's smaller in area than a piece of paper. Though I'm not sure if they're actually making it (as it's a rumor, and an old one at that) and I wouldn't consider if it was over $1500.

The only reason I got a nice laptop is because it was my high school graduation present AND Lenovo had a 25% off everything sale on their website, which - though they stated it had already ended - seems to still be going on.

Oh, and I went with XP - luckily they still offer it as an option.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 21st, 2008, 3:30 am 
Offline

Joined: June 18th, 2008, 8:33 pm
Posts: 20
1920 sounds really good right about now, but I'm stuck with my T42 at 1400x1050 for a while. Most stable laptop I've ever had, though. I love Lenovo--best laptops ever.

I think that the T42 screen is just a little brighter than the T61's, but I haven't tested it side-by-side. 12" laptops are awesome-- i used to have an 11.3 that I carried everywhere until it died-- but I think 13" or 14" is the best for me, because of the tradeoffs-- I like higher resolution, etc. They offer 1400x900 on the 12" tablet but not the 12" laptop-- I hope they fix that.

Hope your Thinkpad experience goes well. By the way, the warranty is extremely worth it. My friend had his hard drive die and he got a new (Seagate) harddrive in two days. That's worth the cost. (Also he's broken the screen, etc, and had that fixed too. It's a good deal.)

And my favorite part of all? They provide disassembly instructions on their website. Try to find THAT at Dell or HP.

_________________
ttrickyy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 21st, 2008, 5:51 am 
Offline

Joined: June 19th, 2008, 1:23 am
Posts: 7
I like how I could stomp on my dad's X300 and in addition to the fact that it would probably still function normally they'd take it and fix it for free to factory condition provided it was still under warranty. We have an old A31 that - despite a broken screen hinge, broken sleep button, broken dock doors, broken PC Card slots, an Ultrabay slot that won't hold things in, a number pad that only works when you hold it down, and a screen frame that easily peels off - still works flawlessly. Doesn't mean that the 12lb two-inch-thick behemoth is any more wieldly, but hey - it's lasted over ten years of hard labor across the world. The timeless ThinkPad mentality lives on; an invincible black plastic rectangle always beats the flimsy competition (unless it's a Toughbook, but that doesn't count).


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, poserpro, sjc1000, Yahoo [Bot] and 59 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group