From: paurea@plan9.escet.urjc.es
To: 9fans@cse.psu.edu
Subject: [9fans] events
Date: Wed, 19 Feb 2003 14:23:02 +0100 [thread overview]
Message-ID: <6ab179dcbf4c6ece11328ca41724fed2@plan9.escet.urjc.es> (raw)
Sorry for the last message. I pressed the Post without noticing...
I am trying to do this Inkey is 4. Stdin is 0. I have noticed two things
1) einit ignores keys others than Emouse and Ekeyboard (I noticed this looking at sources)
2) I don't get the stdin events. Something for us is never printed.
Suggestions?
Gorka
estart(Inkey,Stdin,1); /
einit(Emouse|Ekeyboard|Inkey);
for (;;) {
keyev = event(&gev);
switch(keyev){
case Emouse:
mev=gev.mouse;
if (mev.buttons==2){
goban[pos.x][pos.y]='w';
drawstone(pos,'w');
}
if (mev.buttons==4){
goban[pos.x][pos.y]='d';
drawstone(pos,'d');
}
if (mev.buttons==1) {
goban[pos.x][pos.y]='b';
drawstone(pos,'b');
}
break;
case Ekeyboard:
kbdc=gev.kbdc;
switch(kbdc){
case qkey:
case esckey:
exits(0);
break;
}
break;
case Inkey:
print("something for us...");
readn(Stdin,msg,1);
if(msg[0]!='\n')
break;
readn(Stdin,msg,Msgsz);
pos.x=atoi(&msg[3]);
msg[3]='\0';
pos.y=atoi(&msg[1]);
drawstone(pos,msg[0]);
break;
}
next reply other threads:[~2003-02-19 13:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-19 13:23 paurea [this message]
2003-02-19 13:56 ` Russ Cox
2003-02-19 14:08 ` paurea
2003-02-19 14:13 ` Russ Cox
2003-02-19 14:31 ` paurea
2003-02-19 21:57 ` Russ Cox
2003-02-20 11:18 ` paurea
-- strict thread matches above, loose matches on Subject: below --
2003-02-19 13:20 paurea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ab179dcbf4c6ece11328ca41724fed2@plan9.escet.urjc.es \
--to=paurea@plan9.escet.urjc.es \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).