Offline
Edison Member
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
|
 |
« Reply #15 on: September 19, 2012, 04:58:24 pm » |
Ah, I see. Well, what can I say ? I'm interested too 
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #16 on: September 20, 2012, 01:18:19 am » |
In this instance, it looks like V-USB is being used to emulate a USB keyboard. If this is your goal, a Leonardo makes this functionality quite simple, as it has keyboard and mouse emulation libraries supplied in the IDE.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
|
 |
« Reply #17 on: September 20, 2012, 01:28:44 am » |
...so it would inject the data in whatever app has _focus_ at the moment, right ? If that's the case, the there's a chance that having the "wrong" app in focus while the data comes in would make "strange" things happen...
|
|
|
|
|
Logged
|
|
|
|
|
Gosport, UK
Offline
Faraday Member
Karma: 19
Posts: 3118
|
 |
« Reply #18 on: September 20, 2012, 01:31:47 am » |
That would seem likely.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 3
Posts: 218
Arduino rocks
|
 |
« Reply #19 on: September 20, 2012, 03:24:41 am » |
And does in fact happen if you have say an image maker open
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
|
 |
« Reply #20 on: September 20, 2012, 04:24:17 am » |
And does in fact happen if you have say an image maker open
hmmm.... scary! 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 13
|
 |
« Reply #21 on: September 20, 2012, 11:29:55 am » |
Ahh.. Ok. Yes I've done this in the past - again in VB on windows. I had to find the process ID of the window I was looking for and use a windows API function to activate that window, then the vb.net sendkeys() function to send individual keystrokes to the app. Not sure if you can apply the same thing on linux or not, but here's what I did:
Private Function FindApp() As Int32 ' Loop through process table, return process id of process named 'Notepad.exe' Dim proptr() As Process Dim Pid As Process proptr = Process.GetProcesses() ' Get an array filled with all process IDs For Each Pid In proptr Try If Pid.MainModule.ModuleName = "Notepad.EXE" Then Return Pid.Id ' Notepad found, return process ID End If Catch ex As System.ComponentModel.Win32Exception Catch ex As InvalidOperationException End Try Next End Function
Private Function ActivateApp() As Boolean ' Gives Notepad focus to receive HID keys Dim AppID as integer = FindAPP()
If AppID <> 0 Then ' We found our application! AppActivate(AppID) Return True Else : Return False ' Not running?? End If End Function
To use: ActivateApp() SendKeys.SendWait("Keys to appear in notepad...")
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
|
 |
« Reply #22 on: September 21, 2012, 12:55:32 pm » |
This might be interesting (just saw it mentioned in another thread somewhere): http://www.parallax.com/tabid/393/Default.aspx
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
|
 |
« Reply #23 on: September 21, 2012, 04:19:14 pm » |
Not exactly what you're looking for, but on Linux a way to capture data coming in from the serial port is this:
minicom -D /dev/ttyUSB1 -b 115200 -o -C dump.txt
where /dev/ttyUSB1 must be changed to the actual device (e.g. ttuUSB0, etc.), and 115200 must be equal to the value given in Serial.begin() on the Arduino.
|
|
|
|
|
Logged
|
|
|
|
|
|