onfocus="blur()" only on mobile devices

I have created a custom soft keyboard for mobile devices. The problem is that each time I click an input box it pops up my custom keyboard but it also pops up a soft keyboard of the device. Now, I can do

<input type="text" class="myCustomKeyboard" onfocus="blur()">

This solves the problem of keyboard popping up in mobile devices but this also means I have to use my custom keyboard on a desktop

I am checking for mobile devices using:

 if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 

Is there a way to stop keyboard popup without losing the ability to type using keyboard in desktop devices?