SocramMalaquias Posted September 6, 2011 Share Posted September 6, 2011 (edited) Hello. First of all, don't be fooled by the title, I don't want to make a Keylogger. I have here a DVB-T with a remote IR controller, and its keys are mapped to keyboard keys. Some of them are very simple (for example, CH UP is ¡ and CH DOWN is '), but some aren't. Thus, I would want to know which virtual keys are being pressed (and if it's possible, in what keyboard), so I can then make a script to remap them to some functions, like stopping a video on Windows Media Player, ... Right now I'm trying to use a _IsPressed loop, but I'm unsure if the device uses virtual keys (these special keys Stop, Play, Pause, etc... on newer keyboards) and if _IsPressed support them If it helps, the application came with the following IR configuration file: [General] Name=Default Plugin=HID Device.dll [Custom] MaskCode=0x00FF [CommandMaps] 1=Power_Off,6,80,0,0,0,0,0,0 2=ReturnLastChannel,6,82,0,0,0,0,0,0 3=Volume_Up,6,187,0,0x00,0,0,0,0 4=Volume_Down,6,189,0,0x00,0,0,0,0 5=Next_Chapter,0,187,0,0x00,0,0,0,0 6=Previous_Chapter,0,189,0,0x00,0,0,0,0 7=Num_1,2,49,0,0,0,0,0,0 8=Num_2,2,50,0,0,0,0,0,0 9=Num_3,2,51,0,0,0,0,0,0 10=Num_4,2,52,0,0,0,0,0,0 11=Num_5,2,53,0,0,0,0,0,0 12=Num_6,2,54,0,0,0,0,0,0 13=Num_7,2,55,0,0,0,0,0,0 14=Num_8,2,56,0,0,0,0,0,0 15=Num_9,2,57,0,0,0,0,0,0 16=Full_Screen,0,27,0,0,0,0,0,0 17=Num_0,2,48,0,0,0,0,0,0 18=Stop,8,35,0,0,0,0,0,0 19=Record,6,84,0,0,0,0,0,0 Thanks Edited September 6, 2011 by SocramMalaquias Link to comment Share on other sites More sharing options...
JohnOne Posted September 6, 2011 Share Posted September 6, 2011 (edited) A list of most (if not all) the keys autoit can use can be found under "ASCII Characters" in the help file. Edited September 6, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Zedna Posted September 6, 2011 Share Posted September 6, 2011 I think _IsPressed way will be OK for this. Post your script ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
SocramMalaquias Posted September 6, 2011 Author Share Posted September 6, 2011 (edited) #include <Misc.au3> $d = DllOpen("user32.dll") Dim $pressed[256] Dim $ban[256] $ban[1] = True $ban[2] = True $ban[4] = True While True $show = False For $i = 0 To 256 $press = _IsPressed($i, $d) If $press And Not $pressed[$i] And Not $ban[$i] Then ConsoleWrite($i & @crlf) $show = True EndIf $pressed[$i] = $press Next If $show Then ConsoleWrite("--" & @crlf) Sleep(10) WEnd I found that, for example, the power button is CTRL+ALT+P, but unfortunately the CH UP nor CH DOWN don't get mapped on 0-255 PS: $ban is the keys I don't want to see (1, 2 and 4 are mouse left, right and center button) Edited September 6, 2011 by SocramMalaquias Link to comment Share on other sites More sharing options...
szalaisanyi86 Posted August 1, 2012 Share Posted August 1, 2012 (edited) expandcollapse popupHotKeySet("^!r", "recall") HotKeySet("+", "volup") HotKeySet("-", "voldown") HotKeySet("^!+", "chup") HotKeySet("^!-", "chdown") HotKeySet("^1", "button1") HotKeySet("^2", "button2") HotKeySet("^3", "button3") HotKeySet("^4", "button4") HotKeySet("^5", "button5") HotKeySet("^6", "button6") HotKeySet("^7", "button7") HotKeySet("^8", "button8") HotKeySet("^9", "button9") HotKeySet("^0", "button0") HotKeySet("{ESC}", "zoom") HotKeySet("{END}", "stop") HotKeySet("^!t", "rec") HotKeySet("{SPACE}", "timeshift") HotKeySet("^!p", "power") While 1 WEnd Func recall() ToolTip("RECALL",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func volup() ToolTip("VOLUME UP",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func voldown() ToolTip("VOLUME DOWN",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func chup() ToolTip("CHANNEL NEXT",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func chdown() ToolTip("CHANNEL PREVIOUS",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button1() ToolTip("BUTTON 1",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button2() ToolTip("BUTTON 2",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button3() ToolTip("BUTTON 3",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button4() ToolTip("BUTTON 4",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button5() ToolTip("BUTTON 5",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button6() ToolTip("BUTTON 6",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button7() ToolTip("BUTTON 7",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button8() ToolTip("BUTTON 8",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button9() ToolTip("BUTTON 9",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button0() ToolTip("BUTTON 0",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func zoom() ToolTip("ZOOM",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func stop() ToolTip("STOP",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func rec() ToolTip("REC",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func timeshift() ToolTip("TIMESHIFT",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func power() ToolTip("POWER",@DesktopWidth/2,@DesktopHeight/2) EndFunc Write to Functions! Edited August 1, 2012 by szalaisanyi86 Link to comment Share on other sites More sharing options...
szalaisanyi86 Posted August 1, 2012 Share Posted August 1, 2012 (edited) Sorry! I'm Hungarian! Here English keyboards: Remote key commands: Power = CTRL+ALT+P Vol+ = "+" Vol- = "-" CH+ = CTRL + ALT + "+" CH- = CTRL + ALT + "-" Recall = CTRL + ALT + R 1 = CTRL + 1 2 = CTRL + 2 3 = CTRL + 3 4 = CTRL + 4 5 = CTRL + 5 6 = CTRL + 6 7 = CTRL + 7 8 = CTRL + 8 9 = CTRL + 9 0 = CTRL + 0 Zoom = ESC Stop = END Rec = CTRL + ALT + T Timeshift = SPACE English keyboards! expandcollapse popupHotKeySet("^!r", "recall") HotKeySet("+", "volup") HotKeySet("-", "voldown") HotKeySet("^!+", "chup") HotKeySet("^!-", "chdown") HotKeySet("^1", "button1") HotKeySet("^2", "button2") HotKeySet("^3", "button3") HotKeySet("^4", "button4") HotKeySet("^5", "button5") HotKeySet("^6", "button6") HotKeySet("^7", "button7") HotKeySet("^8", "button8") HotKeySet("^9", "button9") HotKeySet("^0", "button0") HotKeySet("{ESC}", "zoom") HotKeySet("{END}", "stop") HotKeySet("^!t", "rec") HotKeySet("{SPACE}", "timeshift") HotKeySet("^!p", "power") While 1 WEnd Func recall() ToolTip("RECALL",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func volup() ToolTip("VOLUME UP",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func voldown() ToolTip("VOLUME DOWN",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func chup() ToolTip("CHANNEL NEXT",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func chdown() ToolTip("CHANNEL PREVIOUS",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button1() ToolTip("BUTTON 1",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button2() ToolTip("BUTTON 2",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button3() ToolTip("BUTTON 3",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button4() ToolTip("BUTTON 4",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button5() ToolTip("BUTTON 5",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button6() ToolTip("BUTTON 6",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button7() ToolTip("BUTTON 7",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button8() ToolTip("BUTTON 8",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button9() ToolTip("BUTTON 9",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func button0() ToolTip("BUTTON 0",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func zoom() ToolTip("ZOOM",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func stop() ToolTip("STOP",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func rec() ToolTip("REC",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func timeshift() ToolTip("TIMESHIFT",@DesktopWidth/2,@DesktopHeight/2) EndFunc Func power() ToolTip("POWER",@DesktopWidth/2,@DesktopHeight/2) EndFunc Rewrite to Functions! Edited August 1, 2012 by szalaisanyi86 Link to comment Share on other sites More sharing options...
Belini Posted August 1, 2012 Share Posted August 1, 2012 (edited) Maybe this will help: <snip> Edited August 1, 2012 by Melba23 Code removed My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 1, 2012 Moderators Share Posted August 1, 2012 Belini, The code you posted is a full keyboard keylogger - even though it is a pretty poor one. Someone of your experience should know better. I am fed up with repeating myself - use the next 3 days to understand that when I say this I mean it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts