Oct 24, 2010

Schedule

Using QT to develop the GUI interface these days

Made several versions. Now want to make it iphone like, may have to hard code the position of every icons.

GIMP is recommended for icon editing.

Oct 7, 2010

Today Schedule + some input report things

Today Finished:
  1. Create 3 new classes for readWrite form. They are HID(), win32Keyboard() and handler()
  2. Integrate the classes into one.
  3. Spot out the correct process name of the foreground process, then send some hard-coded byte values to the device
  4. Can read report from device and split it into two modes. The first is modifier and another is non-modifier. Modifier consists of 8Bits defined in HID1_11.pdf. Non-modifier somehow can be found by simple maths.
  5. Create an ArrayList to store all key pressed first and released all of them at once.
Going to implement:
  1. Make our process running in background. Reference:
  2. Optimize the program, maybe by minimizing the code size and introducing some algorithms.
  3. Start debugging. Finding any possible bugs.
  4. Get URL from Hwnd, have to try.
  5. Find a way to register hot-key in windows

The format of the HID report is vital for decoding the meaning inside the report.
Page 70 of the HID1_11.pdf which can be downloaded from the USB official website is useful.

Oct 4, 2010

Finished wrapping the HID API library with C# codes. A reading thread is responsible for reading something from the widget.

Following to do are:
  1. Study the pattern of the values returned. If I press a, b and c at the same time, the pattern becomes 00 00 04 05 06 00... If only a is pressed, it is 00 00 04 00 00 ... If only b is pressed, it is 00 00 05 00 00... We should write a "clever" function to analyze it.
  2. Integrate the getForegroundProcess program with this library.
  3. Figure out what should be sent to the widget to identify current running process.
The bugs that make the program unable to read and write data:
  1. I forgot to change the flags and control type respectively.
  2. To write something, nAccess = GENERIC_WRITE; nsharemode= nShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; controlType= 0x02... It is similar if we want to read something.
  3. The overlapped structure is vital for ReadFile to call. It is originally a blocking call. However, we can change its behavior by feeding an overlapped structure to it. Refers to MSDN, the passage about Readfile.
Acknowledgement (HID class only) and some follow-up explanation:
  1. createFile is called with many arguments. These arguments should also be called from other winAPIs. We have to provide GUID at some points... (refer to the openDev src code in the class HID and also documentation from MSDN)
  2. Make reference to genericHID.cs and its author. It gives definition of each winAPI function useful for our HID class.
  3. Also acknowledge to author of the UseHIDSample.cs

Oct 2, 2010

using winAPI writeFile

  1. Have to check the flags, what do they mean...
  2. Have to ensure everything is sent successfully
  3. Try to lock the device, avoid other windows application sending things to it.