bluetoothengine/bthid/keyboard/src/keyboard.cpp
branchRCL_3
changeset 12 b23265fb36da
parent 11 f7fbeaeb166a
child 18 5a89845f78e2
equal deleted inserted replaced
11:f7fbeaeb166a 12:b23265fb36da
   138 
   138 
   139     iPointBufQueue.Close();
   139     iPointBufQueue.Close();
   140 
   140 
   141     if (iComboDevice)
   141     if (iComboDevice)
   142         {
   142         {
   143         RProperty::Set( KPSUidBthidSrv, KBTMouseCursorState, ECursorHide );
   143         RProperty::Set( KPSUidBthidSrv, KBTMouseCursorState, ECursorNotInitialized );
   144         }
   144         }
   145 
   145 
   146     if (iSettings)
   146     if (iSettings)
   147         delete iSettings;
   147         delete iSettings;
   148     }
   148     }
   286     {
   286     {
   287     iDriverState = EDisabled;
   287     iDriverState = EDisabled;
   288     CancelAllKeys();
   288     CancelAllKeys();
   289     if (iComboDevice)
   289     if (iComboDevice)
   290         {
   290         {
   291         RProperty::Set( KPSUidBthidSrv, KBTMouseCursorState, ECursorHide );
   291         RProperty::Set( KPSUidBthidSrv, KBTMouseCursorState, ECursorNotInitialized );
   292         }
   292         }
   293     }
   293     }
   294 
   294 
   295 //----------------------------------------------------------------------------
   295 //----------------------------------------------------------------------------
   296 // CHidMouseDriver::LaunchApplicationL
   296 // CHidMouseDriver::LaunchApplicationL
   341                 {
   341                 {
   342                 if (iComboDevice)
   342                 if (iComboDevice)
   343                     {
   343                     {
   344                     TInt mouseStatus;
   344                     TInt mouseStatus;
   345                     TInt err = RProperty::Get( KPSUidBthidSrv, KBTMouseCursorState, mouseStatus );
   345                     TInt err = RProperty::Get( KPSUidBthidSrv, KBTMouseCursorState, mouseStatus );
   346                     if ( !err && (static_cast<THidMouseCursorState>(mouseStatus) == ECursorHide) )
   346                     if ( !err &&
       
   347                         ((static_cast<THidMouseCursorState>(mouseStatus) == ECursorRedraw)|| 
       
   348                          (static_cast<THidMouseCursorState>(mouseStatus) == ECursorReset)) )
   347                         {
   349                         {
   348                         err = RProperty::Set( KPSUidBthidSrv, KBTMouseCursorState, ECursorShow );
   350                         err = RProperty::Set( KPSUidBthidSrv, KBTMouseCursorState, ECursorShow );
       
   351                         DBG(RDebug::Print(
       
   352                                  _L("[BTHID]\tCHidKeyboardDriver::DataIn() ECursorRedraw ||ECursorReset ")) );
   349                         }
   353                         }
       
   354 
       
   355                     CursorRedraw();
   350                     }
   356                     }
   351                 InterruptData(aPayload);
   357                 InterruptData(aPayload);
   352                 }
   358                 }
   353             break;
   359             break;
   354 
   360 
   460         if (!iButton2Down)
   466         if (!iButton2Down)
   461             {
   467             {
   462             iButton2Down = ETrue;
   468             iButton2Down = ETrue;
   463             TRawEvent rawEvent;
   469             TRawEvent rawEvent;
   464             rawEvent.Set(TRawEvent::EKeyDown, EStdKeyApplication0);
   470             rawEvent.Set(TRawEvent::EKeyDown, EStdKeyApplication0);
       
   471             CursorRedraw();
   465             UserSvr::AddEvent(rawEvent);
   472             UserSvr::AddEvent(rawEvent);
   466             }
   473             }
   467         }
   474         }
   468     else
   475     else
   469         {
   476         {
   470         if (iButton2Down)
   477         if (iButton2Down)
   471             {
   478             {
   472             iButton2Down = EFalse;
   479             iButton2Down = EFalse;
   473             TRawEvent rawEvent;
   480             TRawEvent rawEvent;
   474             rawEvent.Set(TRawEvent::EKeyUp, EStdKeyApplication0);
   481             rawEvent.Set(TRawEvent::EKeyUp, EStdKeyApplication0);
       
   482             CursorRedraw();
   475             UserSvr::AddEvent(rawEvent);
   483             UserSvr::AddEvent(rawEvent);
   476             }
   484             }
   477         }
   485         }
   478 
   486 
   479     if (KButton3 == buttonByte)
   487     if (KButton3 == buttonByte)
  1927     {
  1935     {
  1928     DBG(RDebug::Print(_L("[HID]\tCHidKeyboardDriver::TimerExpired, cancel all key presses")));
  1936     DBG(RDebug::Print(_L("[HID]\tCHidKeyboardDriver::TimerExpired, cancel all key presses")));
  1929     CancelAllKeys();
  1937     CancelAllKeys();
  1930     }
  1938     }
  1931 
  1939 
       
  1940 void CHidKeyboardDriver::CursorRedraw()
       
  1941     {
       
  1942     TInt mouseStatus;
       
  1943 
       
  1944     TInt err = RProperty::Get( KPSUidBthidSrv, KBTMouseCursorState, mouseStatus );
       
  1945     if ( !err )
       
  1946         {
       
  1947         err = RProperty::Set( KPSUidBthidSrv, KBTMouseCursorState, ECursorRedraw );
       
  1948         DBG(RDebug::Print(
       
  1949              _L("[BTHID]\tCHidKeyboardDriver::CursorRedraw() X->ECursorRedraw") ) );
       
  1950         }
       
  1951     }
       
  1952 
       
  1953 // ----------------------------------------------------------------------
  1932 // End of file
  1954 // End of file