View Single Post
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#8
Okay, tick to another box, tactile feedback covered

Checking syslog I found that the vibra device is created as "/dev/input/event6" and reading the device while trying out virtual keyboard indeed threw up some codes. Writing the events back to device produce small vibration. Nice!

Code:
  int fdev, ret;
  struct input_event ievent;

  if ((fdev = open("/dev/input/event6",  O_RDWR)) < 0) {
    perror("cannot open output device");
    return -1;
  }

  ievent.type = EV_FF;
  ievent.code = 30;
  ievent.value = 1;
  if((ret = write(fdev, &ievent ,sizeof(ievent))) < sizeof(ievent)) {
    printf("\nsent only %d bytes on write");
    return -1;
  }
Now, originally I thought of loading up .png of a keyboard image as a visual guide to the typing using first "/usr/bin/show_png" to show the image, and then launching my "silly_kbd" utility to capture touch input.
However, I need to have shift/caps-lock functionality, so what I need to do is to change bitmaps on the screen while running my utility.

There are propably at least 3 ways of doing this, which are of varying complexity...
  • If I can get source code of show_png I could stitch that in my utility, easiest but I am not sure if it is non-free Nokia code?
  • Can I launch external program via "system()" call or something so I can call the utility from inside my own utility... This is doable but not really optimal
  • I could exit from my utility with an EC that the calling shell script knows that it needs to change the background image and relaunch the kbd utility... not really nice because I would need to handle the already inputted characters somehow...

Any thoughts on this?
 

The Following 2 Users Say Thank You to juiceme For This Useful Post: