Coder Social home page Coder Social logo

qdevice's Introduction

qDevice logo

qDevice

qDevice is a Roblox Luau package designed to detect platforms of most kinds on Roblox with ease and with a simple interface.

Reminder

qDevice uses a lot of UserInputService logic in it that makes it impossible to use on the server. You can only use qDevice on the client. That is the only warning

Documentation:

Methods

qDevice.IsOrientationLandscape(): boolean

This returns true if the orientation of a mobile device is in landscape mode. This is done by comparing screen size values and checking if the user has touch enabled.

qDevice.IsOrientationPortrait(): boolean

This returns true if the orientation of a mobile device is in portrait mode. This is done by comparing screen size values and checking if the user has touch enabled.

qDevice.GetDeviceOrientation(): string

This is a general function that will return a string based on the mode that it was detected to be in.

qDevice.IsXbox(): boolean

This returns true if the user is found to be on Xbox. This is done by checking the string for a keycode returning "ButtonA", as well as checking for Ten Foot Interface.

qDevice.IsPlayStation(): boolean

This is a similar implementation to IsXbox() but by checking if a keycode will return "ButtonCross" as a string, also checking for Ten Foot Interface.

qDevice.IsConsole(): boolean

This returns true or false if the platform is any console, by checking for Ten Foot Interface.

Warning

This function is hacky. Like, sorta hacky. It checks if the X or Y values of the screen size are below 600 depending on orientation.

qDevice.GetMobileDevice(): string

This will return a string that says "Phone" or "Tablet" depending on what it finds and for the orientation

qDevice.IsPhone(): boolean

This function will return true if it finds a phone.

qDevice.IsTablet(): boolean

This function will return true if it finds a phone

qDevice.IsVR(): boolean

This returns true if it finds a VR headset active

qDevice.IsPC(): boolean

This will find if a PC is active by checking against all other devices.

Note

This function is experimental (meaning that implementing this in production might be a big no-no.) Set QDEV_EXPERIMENTAL to true to enable this.

qDevice.IsControllerOnPC(): boolean

This special function will look for if a controller is connected on PC.

qdevice's People

Contributors

break-core avatar voiditedev avatar ryloriz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.