Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » How does UPP classify keys (key abstraction)
How does UPP classify keys [message #54579] Mon, 17 August 2020 07:28 Go to previous message
chivstyle is currently offline  chivstyle
Messages: 8
Registered: August 2020
Location: China
Promising Member
Hi,

I'm developing our virtual terminal, but I'm confused about the key abstraction. I've read the manual book, still confused.

I tested these codes below, it worked well so far. Can anyone help me please ?

bool SerialConnVT::Key(dword key, int)
{
    bool processed = false;
    // split key and flags.
	dword flags = K_CTRL | K_ALT | K_SHIFT;
    dword d_key = key & ~(flags | K_KEYUP); // key with delta
    flags = key & flags;
    //
	if (d_key & K_DELTA) { // can't capture RETURN
	    if (key & K_KEYUP) {
	        processed = ProcessKeyUp(d_key, flags);
	    } else {
	        processed = ProcessKeyDown(d_key, flags);
	    }
	} else {
	    if (key < 0xffff) {
	        processed = ProcessChar(d_key);
	        ProcessKeyDown(d_key, flags);
	    } else if (key & K_KEYUP) {
	        // RETURN will reach here
	        ProcessKeyUp(d_key, flags);
	    }
	}
	if (processed) {
	    mScrollToEnd = true;
	}
	return processed;
}
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Linking on OpenIndiana
Next Topic: [Proposition] Simply source package manager for Upp
Goto Forum:
  


Current Time: Thu May 23 08:29:43 CEST 2024

Total time taken to generate the page: 0.01451 seconds