/// <summary> /// Handles the KeyPress event of the m_keyboardHook control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="VmcController.MceState.KeyboardHookEventArgs"/> instance containing the event data.</param> void KeyPressEvent(object sender, KeyboardHookEventArgs e) { Trace.TraceInformation("keyboardHook_KeyPress() Start"); Trace.Indent(); try { // Send the data to the clients Trace.TraceInformation("keyboardHook_KeyPress() event #{0}", e.vkCode); m_socketServer.SendMessage(String.Format(CultureInfo.InvariantCulture, "KeyPress={0}\r\n", e.vkCode)); } catch (Exception ex) { Trace.TraceError(ex.ToString()); } finally { Trace.Unindent(); Trace.TraceInformation("keyboardHook_KeyPress() End"); } }
private void KeyPressEvent(object sender, KeyboardHookEventArgs e) { try { // Send the data to the clients SocketServer.SendMessage( String.Format(CultureInfo.InvariantCulture, "KeyPress={0}\r\n", e.vkCode) ); } catch (Exception ex) { Trace.TraceError(ex.ToString()); } finally { Trace.Unindent(); Trace.TraceInformation("keyboardHook_KeyPress() End"); } }