开发者

Qt for Symbian - Detecting touch/non-touch devices

开发者 https://www.devze.com 2023-01-31 19:49 出处:网络
I\'m porting a game for Symbian which supports both a touch & non-touch UI. I need to be able to tell if the device has a touch screen on start-up so I can enable the appropriate mode.

I'm porting a game for Symbian which supports both a touch & non-touch UI.

I need to be able to tell if the device has a touch screen on start-up so I can enable the appropriate mode.

After googling for hours and going though the Qt Docs I found QSysInfo but this merely provides the version of the Symbian device.

Is there a way t开发者_高级运维o get the actual capabilities of the device? There must be a way to tell if the device has a touch screen...!

I'm using the latest QtCreator with the NokiaSDK.

Thank you in advance, Nikos.


I found the answer:

QSystemDeviceInfo cSystemInfo;

bool HasTouchScreen()
{
    DWORD dwFlags = cSystemInfo.inputMethodType();

    if ((dwFlags & (QSystemDeviceInfo::SingleTouch|QSystemDeviceInfo::MultiTouch)) != 0)
        return true;

    return false;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号