Instant Messaging Presence Control

Oscar Deniz, Modesto Castrillón.
Universidad de Las Palmas de Gran Canaria

Download IM Presence Control (.msi file, 7.4MB)
Download video (212KB) requires DivX codec

Instant Messaging Presence Control

The widespread availability of digital video cameras is opening new human-computer interaction possibilities. Today, most laptopts are equipped with an standard webcam. Advances in face detection allow new possibilities of presence control. The ‘IM Presence Control’ application allows an Instant Messaging user (Microsoft Messenger, Yahoo Messenger, …) to control two features of the IM client:
Away/online status
Smile emoticons
The application developed is able to detect when the user is in front of the laptop or away. This is achieved using face detection (the ENCARA2 real-time face detection system, see http://mozart.dis.ulpgc.es/Gias/modesto_eng.html). A smile detector (based on a cascade of Haar classifiers) automatically inserts smileys or other emoticons in the conversation window when the user is smiling. The character string of the emoticon and the exact form of the insertion can be adjusted by the user. Keystroke insertion is achieved with a modified version of Mustafa Demirhan’s Keystroke Engine (http://www.codeguru.com/cpp/misc/misc/applicationcontrol/article.php/c3743/). An example insertion string is:

Hello World!<ENTER><REPEAT 10>I love open source<ENTER><END_REPEAT>
            Mustafa Demirhan

All special keys are put between ‘<‘ and ‘>’ characters. For example, to simulate an Enter key, you should use . Or, to press the Shift key, use . Here are some more examples:

  • To send Ctrl+A, use <CTRL>A.
  • To send Alt+F4, use <ALT><F4>.
  • To send Ctrl+Alt+Shift+A, use <CTRL+ALT+SHIFT>A.
  • You also can use <CTRL+ALT>, <CTRL+SHIFT>, and <ALT+SHIFT>.
  • To hold the Shift key and many other keys, use <SHIFT_LOCK>write your keys here<SHIFT_UNLOCK>.
  • You also can use <ALT_LOCK>, <ALT_UNLOCK>, <CTRL_LOCK>, and <CTRL_UNLOCK>.
  • To add a delay, use <DELAY xxx> where xxx is the amount of time in miliseconds. For example, <DELAY 1500> waits 1.5 seconds.
  • To repeat a sequence of keys 100 times, use <REPEAT 100>you keys here<END_REPEAT>. Please note that nested repeats are not supported.

The engine is used to send keystroke strings to a specified window. The window is specified by the title (it is sufficient to enter a part of it is sufficient, though comparison is case sensitive). Thus, keystrokes can be sent to the IM client conversation window, or the the IM client main window, to insert emoticons or change status. For example, the keystroke string for inserting a smiley could be:

” 🙂 ”

That keystroke would insert a smiley at the cursor position in the conversation window. For inserting the smiley at the beginning of the current text line of the conversation window one may use:

” )-:”
Note in this case that a must be sent before each character because the conversation window is continuously placing the cursor at the end of the line. Other options are possible.

To change a status, a typical string would be:

“ade” (example for Windows Live Messenger, Spanish version, this changes user status to ‘Away’). Smile strings are only sent if the specified window is currently the foreground window on the desktop. Status strings are only sent if the specified window has not been minimized to the tray.

The options of the application are:

  • IM application window title string
  • IM conversation window title string
  • Smile keystroke string
  • Big smile keystroke string (typically :-D))
  • Time between sending of smile keystroke strings (in seconds, 0 to wait for a no-smile before sending a new smiley)
  • Away keystroke string
  • Online keystroke string
  • Time without face before sending an Away keystroke string (in seconds)
  • Smile detections before a smile or big smile keystroke string is sent
  • Sensitivity (the smaller the more smile detections)
  • Smile/Big smile threshold
  • Show/hide live video window

IM Presence Control allows to see a window with the live video input, though the default behavior is to kept it hidden. The application can be executed with the argument “-s”, which makes it start automatically and remain minimized in the tray.

The application is distributed under this license. Basically, you can use it or redistribute it for non-commercial purposes, as long as the authors are acknowledged. Enjoy!

Download IM Presence Control (.msi file, 7.4MB)
Download video (212KB) requires DivX codec

 

 

 

Instant Messaging Presence Control

Oscar Deniz, Modesto Castrillón.
Universidad de Las Palmas de Gran Canaria
Descargar IM Presence Control (fichero .msi, 7.4MB)

Descargar video (212KB) requiere codec DivX

La gran disponibilidad de cámaras de video digitales está abriendo nuevas posibilidades de interacción hombre-ordenador. Hoy en día, la mayoría de los ordenadores portátiles están equipados con una webcam. Los avances en detección de caras permiten nuevas soluciones de control de presencia. La aplicación ‘IM Presence Control’ permite a un usuario de mensajería instantánea (Microsoft Messenger, Yahoo Messenger, …) controlar dos características del cliente:

  • Estado Ausente/Conectado
  • Emoticonos de sonrisa (smileys)

La aplicación desarrollada es capaz de detectar si el usuario está frente al portátil o está ausente. Esto se consigue con la detección de caras que proporciona la librería ENCARA2, ver (http://mozart.dis.ulpgc.es/Gias/modesto.html). Un detector de sonrisas (basado en una cascada de clasificadores de Haar) inserta automáticamente smileys u otros emoticonos en la ventana de conversación cuando el usuario está sonriendo. Se puede ajustar la cadena de caracteres del emoticono y la forma exacta de la inserción. La inserción de pulsaciones de teclado se logra empleando una versión modificada de la Keystroke Engine de Mustafa Demirhan (ver http://www.codeguru.com/cpp/misc/misc/applicationcontrol/article.php/c3743/). Una cadena de pulsaciones ejemplo es:

Hello World!<ENTER><REPEAT 10>I love open source<ENTER><END_REPEAT>
            Mustafa Demirhan

Las teclas especiales van delimitadas por los caracteres ‘<‘ y ‘>’. Por ejemplo, para simular la tecla Enter, se debe escribir <ENTER>. O, para pulsar Shift, se debe escribir <SHIFT>. Más ejemplos:

  • Para enviar Ctrl+A, usa <CTRL>A.
  • Para enviar Alt+F4, usa <ALT><F4>.
  • Para enviar Ctrl+Alt+Shift+A, usa <CTRL+ALT+SHIFT>A.
  • Tambien puedes usar <CTRL+ALT>, <CTRL+SHIFT>, y <ALT+SHIFT>.
  • Para mantener la tecla Shift (u otras) pulsada, usa <SHIFT_LOCK>tus teclas aquí<SHIFT_UNLOCK>.
  • Tambien puedes usar <ALT_LOCK>, <ALT_UNLOCK>, <CTRL_LOCK>, y <CTRL_UNLOCK>.
  • Para añadir una espera, usa <DELAY xxx> donde xxx son milisegundos. Por ejemplo, <DELAY 1500> espera 1.5 segundos.
  • Para repetir una secuencia de teclas 100 veces, usa <REPEAT 100>tus teclas aquí<END_REPEAT>. No se permiten REPEATs anidados.

El Keystroke Engine se usa para enviar secuencias de pulsaciones a una ventana concreta. La ventana se especifica por el título (es suficiente una parte del título, aunque se respetan las mayúsculas/minúsculas). Así, se envían pulsaciones a la ventana de conversación del cliente IM, para insertar emoticonos, o a la ventana principal, para cambiar el estado. Por ejemplo, una posible cadena para insertar un smiley sería:

” 🙂 ”

Eso insertaría un smiley en la posición del cursor en la ventana de conversación. Para insertar un smiley al comienzo de la actual línea de texto de la ventana de conversación podríamos usar:

“<HOME> <HOME>)<HOME>-<HOME>:<END>”

Nota que en este caso se debe enviar un antes de cara carácter porque la ventana de conversación esta continuamente colocando el cursor al final de la línea. Otras opciones son posibles.

Para cambiar de estado, una cadena típica sería:

“<ALT>ade” (ejemplo para Windows Live Messenger, versión Español, esto cambiar el estado a ‘Ausente’). Las cadenas de sonrisa solo se envían a la ventana especificada si ésta es la de primer plano. Las de cambio de status son se envían si la ventana especificada no se ha minimizado a la zona de notificaciones (tray).

Las opciones de la aplicación son:

  • Cadena de título de la ventana principal del cliente IM
  • Cadena de título de la ventana de conversación del cliente IM
  • Cadena de pulsaciones del smiley (sonrisa)
  • Cadena de pulsaciones de gran sonrisa (normalmente :-D)
  • Tiempo entre envíos de la cadena de pulsaciones de smiley (en segundos, 0 para esperar a una no-sonrisa antes de enviar un nuevo smiley)
  • Cadena de pulsaciones para ‘Ausente’
  • Cadena de pulsaciones para ‘Conectado’
  • Tiempo sin cara detectada antes de enviar un ‘Ausente’ (segundos)
  • Detecciones de sonrisa antes de enviar la cadena de pulsaciones de sonrisa o gran sonrisa
  • Sensibilidad (cuanto menor, más detecciones de sonrisa)
  • Umbral sonrisa/gran sonrisa
  • Mostrar/esconder la ventana con el video tomado por la webcam

IM Presence Control permite ver una ventana con el video capturado por la webcam, si bien el comportamiento por defecto es no mostrar esta ventana. Se puede ejecutar la aplicación con el parámetro “-s”, con el fin de que arranque automáticamente y se minimize a la zona de notificaciones (tray).

La aplicación se distribuye bajo esta licencia. Básicamente, puedes usarla y redistribuirla sin fines comerciales, siempre que se especifique los nombres de los autores.

Descargar IM Presence Control (fichero .msi, 7.4MB)
Descargar video (212KB) requiere codec DivX