Jump to content

Keyboard programmability


Recommended Posts

Hello there,

 

Since shipping is coming closer, I was wondering if there will be the possibility to not only reprogram the keys and shortcuts but also the option to assign keys to touchscreen locations?

That way you could use your keyboard as in emulators over quite a lot of standard. touchscreen games. I'm imagining WASD for movement, maybe in a survival game "F" to pick up stuff, etc. - with the keys assigned to specific screen locations.

I've seen this before with another phone.

 

Also, I'm currently using "Clavis Keyboard" as an onboard keyboard. Apart from it having the computer keyboard layout, it also has the option to assign makros to CTRL+1 to CTRL+0 to output text that was set before. It's like CTRL+V but with permanently saved text, codes, etc.

Will this be possible with the Pro1?

 

Since I don't have widespread programming knowledge, I wouldn't be able to reprogram it myself.

Will these things be possible by the hardware design of the device?

Link to post
Share on other sites

Last time I checked on some software for generating touch inputs in place of any hardware input, I kinda didn't find anything that wasn't looking extremely shady with privacy concerns, worked on modern Android, worked to begin with or wasn't tied to a hardware vendor's system.

In the past I faintly remember such software mentioned for other devices, but it's been years. What app would one actually use these days? It would likely need root, which is fine, but I still didn't really find anything useful.

Link to post
Share on other sites

I've heard about a gaming phone recently that offered the ability to assign keys (or buttons equivalently) to screen input.

 

That's why I was asking. I wonder if you could simply program a function for a key input (which I doubt) or if there need to be hardware requirements to do so. That way, if the keyboard just tells the system to output a specific key (most probably defined in a keychar file), such functions (screen input, makros) wouldn't be easily possible. Well, Makros could probably be set in the keychar file (which would be fine for me), but it would be a nice option to use the keyboard for functions that allow you to use a phone in different ways.

 

But maybe my question was just too early. We'll have to see it ourselves what the keyboard will offer.

Link to post
Share on other sites
I’ve heard about a gaming phone recently that offered the ability to assign keys (or buttons equivalently) to screen input.

 

That’s why I was asking. I wonder if you could simply program a function for a key input (which I doubt) or if there need to be hardware requirements to do so. That way, if the keyboard just tells the system to output a specific key (most probably defined in a keychar file), such functions (screen input, makros) wouldn’t be easily possible. Well, Makros could probably be set in the keychar file (which would be fine for me), but it would be a nice option to use the keyboard for functions that allow you to use a phone in different ways.

 

But maybe my question was just too early. We’ll have to see it ourselves what the keyboard will offer.

 

To my knowledge they have not made any special functionality here. It is a matter of making use of what is already build into Android.

 

They added a launcher that uses the keyboard and landscape better than the Android default. But I think it would work exactly the same if you used an external BT keyboard with the same logical keys.

The only difference is the Logo-key that I suspect is handled hardware-wise in a separate way - but I might be wrong.

Link to post
Share on other sites
I’ve heard about a gaming phone recently that offered the ability to assign keys (or buttons equivalently) to screen input.

 

That’s why I was asking. I wonder if you could simply program a function for a key input (which I doubt) or if there need to be hardware requirements to do so. That way, if the keyboard just tells the system to output a specific key (most probably defined in a keychar file), such functions (screen input, makros) wouldn’t be easily possible. Well, Makros could probably be set in the keychar file (which would be fine for me), but it would be a nice option to use the keyboard for functions that allow you to use a phone in different ways.

 

But maybe my question was just too early. We’ll have to see it ourselves what the keyboard will offer.

 

It should be possible to write a programm which does that.

Basically you could assign keys to simulated touchscreen input:

 

iew.setOnTouchListener(new OnTouchListener()

{

public boolean onTouch(View v, MotionEvent event)

{

Toast toast = Toast.makeText(

getApplicationContext(),

"View touched",

Toast.LENGTH_LONG

);

toast.show();

 

return true;

}

});

 

// Obtain MotionEvent object

long downTime = SystemClock.uptimeMillis();

long eventTime = SystemClock.uptimeMillis() + 100;

float x = 0.0f;

float y = 0.0f;

// List of meta states found here: developer.android.com/reference/android/view/KeyEvent.html#getMetaState()

int metaState = 0;

MotionEvent motionEvent = MotionEvent.obtain(

downTime,

eventTime,

MotionEvent.ACTION_UP,

x,

y,

metaState

);

 

// Dispatch touch event to view

view.dispatchTouchEvent(motionEvent);

 

 

(Source: https://stackoverflow.com/questions/4396059/how-to-simulate-a-touch-event-in-android)

 

Of course you must run that code while another software is running which could be solved with something like that:

https://developer.android.com/studio/test/monkeyrunner

 

There is also this: https://github.com/RobotiumTech/robotium which seems to be very potent, but I don't know if you can trigger it on keypresses.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms