1*c099b74eSFreeman Lou /* 2*c099b74eSFreeman Lou * Copyright 2014 Freeman Lou <freemanlou2430@yahoo.com> 3*c099b74eSFreeman Lou * All rights reserved. Distributed under the terms of the MIT license. 4*c099b74eSFreeman Lou */ 5*c099b74eSFreeman Lou #include "VirtualKeyboardInputDevice.h" 6*c099b74eSFreeman Lou 7*c099b74eSFreeman Lou extern "C" BInputServerDevice* 8*c099b74eSFreeman Lou instantiate_input_device() 9*c099b74eSFreeman Lou { 10*c099b74eSFreeman Lou return new(std::nothrow) VirtualKeyboardInputDevice(); 11*c099b74eSFreeman Lou } 12*c099b74eSFreeman Lou 13*c099b74eSFreeman Lou 14*c099b74eSFreeman Lou VirtualKeyboardInputDevice::VirtualKeyboardInputDevice() 15*c099b74eSFreeman Lou : 16*c099b74eSFreeman Lou BInputServerDevice() 17*c099b74eSFreeman Lou { 18*c099b74eSFreeman Lou fKeyboardWindow = new VirtualKeyboardWindow(); 19*c099b74eSFreeman Lou } 20*c099b74eSFreeman Lou 21*c099b74eSFreeman Lou 22*c099b74eSFreeman Lou status_t 23*c099b74eSFreeman Lou VirtualKeyboardInputDevice::SystemShuttingDown() 24*c099b74eSFreeman Lou { 25*c099b74eSFreeman Lou if (fKeyboardWindow) 26*c099b74eSFreeman Lou fKeyboardWindow->PostMessage(SYSTEM_SHUTTING_DOWN); 27*c099b74eSFreeman Lou return B_OK; 28*c099b74eSFreeman Lou } 29*c099b74eSFreeman Lou 30*c099b74eSFreeman Lou 31*c099b74eSFreeman Lou status_t 32*c099b74eSFreeman Lou VirtualKeyboardInputDevice::InitCheck() 33*c099b74eSFreeman Lou { 34*c099b74eSFreeman Lou return BInputServerDevice::InitCheck(); 35*c099b74eSFreeman Lou } 36*c099b74eSFreeman Lou 37*c099b74eSFreeman Lou 38*c099b74eSFreeman Lou status_t 39*c099b74eSFreeman Lou VirtualKeyboardInputDevice::Start(const char* name, void* cookie) 40*c099b74eSFreeman Lou { 41*c099b74eSFreeman Lou fKeyboardWindow->Show(); 42*c099b74eSFreeman Lou 43*c099b74eSFreeman Lou } 44