/*! * It dispatches the OnKeyPress event to HOOPS/MVO, which will in turn dispatch it to the current HBaseOperator object * The state flags are mapped to HOOPS/MVO abstracted flags * * \param e Provides data for System.Windows.Forms.UserControl.KeyPress event */ public new void OnKeyPress(KeyPressEventArgs e) { if (m_pHView != null) { if (m_lastKeyPressed < 0 || m_lastKeyPressed >= m_keyPairs.Length) { // do nothing because array out of bounds will occur. } else { try { m_keyPairs[m_lastKeyPressed] = e.KeyChar; HEventInfo hevent = new HEventInfo(m_pHView); uint flags = MapModifierKeys(0); hevent.SetKey(HEventType.HE_KeyDown, (uint)e.KeyChar, 1, flags); m_pHView.InjectEvent(hevent); } catch { Trace.WriteLine("HPanel.OnKeyPress exception:key=" + m_lastKeyPressed.ToString()); } } } }
/*! * This method is called from HNForm OnKeyUp method * * It dispatches the OnKeyUp event to HOOPS/MVO, which will in turn dispatch it to the current HBaseOperator object * The state flags are mapped to HOOPS/MVO abstracted flags * * \param e Provides data for System.Windows.Forms.Control.KeyUp event */ public new void OnKeyUp(KeyEventArgs e) { if (m_pHView != null) { HEventInfo hevent = new HEventInfo(m_pHView); uint flags = MapModifierKeys(0); hevent.SetKey(HEventType.HE_KeyUp, (uint)m_keyPairs[e.KeyValue], 1, flags); m_pHView.InjectEvent(hevent); } }
/*! * This method is called from HNForm OnKeyPress method * * It dispatches the OnKeyDown event to HOOPS/MVO, which will in turn dispatch it to the current HBaseOperator object * The state flags are mapped to HOOPS/MVO abstracted flags * * \param e Provides data for System.Windows.Forms.Control.KeyPress event */ public new void OnKeyPress(KeyPressEventArgs e) { if (m_pHView != null) { m_keyPairs[m_lastKeyPressed] = e.KeyChar; HEventInfo hevent = new HEventInfo(m_pHView); uint flags = MapModifierKeys(0); hevent.SetKey(HEventType.HE_KeyDown, (uint)e.KeyChar, 1, flags); m_pHView.InjectEvent(hevent); } }
/*! * This method is called from HNForm OnKeyDown method * * It dispatches the OnKeyDown event to HOOPS/MVO, which will in turn dispatch it to the current HBaseOperator object * The state flags are mapped to HOOPS/MVO abstracted flags * * \param e Provides data for System.Windows.Forms.Control.KeyDown event */ public new void OnKeyDown(KeyEventArgs e) { if (m_pHView != null) { m_lastKeyPressed = e.KeyValue; if (e.KeyCode == Keys.ShiftKey || e.KeyCode == Keys.ControlKey) { HEventInfo hevent = new HEventInfo(m_pHView); uint flags = MapModifierKeys(0); hevent.SetKey(HEventType.HE_KeyDown, 0, 1, flags); m_pHView.InjectEvent(hevent); } } }
/*! * It dispatches the OnKeyUp event to HOOPS/MVO, which will in turn dispatch it to the current HBaseOperator object * The state flags are mapped to HOOPS/MVO abstracted flags * * \param e Provides data for System.Windows.Forms.UserControl.KeyUp event */ public new void OnKeyUp(System.Windows.Forms.KeyEventArgs e) { if (m_pHView != null) { if (e.KeyValue < 0 || e.KeyValue >= m_keyPairs.Length) { // do nothing because array out of bounds will occur. } else { try { HEventInfo hevent = new HEventInfo(m_pHView); uint flags = MapModifierKeys(0); hevent.SetKey(HEventType.HE_KeyUp, (uint)m_keyPairs[e.KeyValue], 1, flags); m_pHView.InjectEvent(hevent); } catch { Trace.WriteLine("HPanel.OnKeyUp exception:key=" + e.KeyValue.ToString()); } } } }