intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Feb 22, 2019 12:25 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Jan 14, 2019 3:52 pm 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 67
Hi,

I tried to google but the words that came to my mind "notification alarm", "bell sound", etc. all link to standard tutorials with an alarm clock in it or a bell that chimes but NOT what I want. ^^ So let's try here (again). If I do something like this:

Code:
"Input Loop Test" by HtF

TestRoom is a room.

TestReply is a number that varies. TestReply is 0;

When play begins:
   say "Choose 1,2 or 0? ";
   let x be the response of the player;
   say "[x]";
   end the story.
   

To decide which number is the response of the player: (- (YesOrNoKey()) -).
 
Include (-
[ YesOrNoKey ch;
   do { ch = VM_KeyChar(); } until (ch == '1' or '2' or '0');
   return ch;
]; -).


or use "pause the game" provided by Emily Short, there is always this nasty sound as soon as you hit the key which reminds me of the "bell sound" (CTRL-G) on a terminal. Is there a way to disable that terribly annoying sound? I mean - it would be ok if the player hits the wrong key but that sound plays even when the correct key is being hit ... ack!


Last edited by Harald Schuster on Mon Jan 14, 2019 4:25 pm, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Jan 14, 2019 4:10 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5921
What interpreter are you using?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Jan 14, 2019 4:22 pm 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 67
Oh, drat! I should have been more specific - I mean the Inform 7 IDE itself. I use wingit and it's completely silent there. But the IDE keeps making this ugly noise.

Edit: Edited the topic so the intention is clearer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Jan 14, 2019 6:01 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 428
I can't help, I'm afraid --- the Inform IDE has never beeped at me.

But I notice that your code shows up an Inform bug. If I RESTART after pressing one of the magic keys (say '1'), then I get the same prompt as before; but this time VM_KeyChar() does not prevent key-presses from showing up at the command line.

(I amended "return ch;" to "return ch - 48;" in your code to get the correct characters to print.)
Quote:
Choose 1,2 or 0? abcdefg11


*** The End ***




Would you like to RESTART, RESTORE a saved game, QUIT or UNDO the last command?
>

I wonder whether this would this be a bug in VM_KeyChar(), or in the actual restart routine?

(I tried replacing "end the story" with a direct call to I6 @restart, but it threw up the same problem.)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Jan 14, 2019 8:05 pm 
Offline

Joined: Wed Nov 12, 2014 5:20 pm
Posts: 222
I get these beeps when I run my soundtest in the Windows Inform 7 IDE, but not in the macOS IDE or in any other interpreter I've tried.

When running the AUTOTEST command, it beeps every time you advance the test by pressing any button other than Esc (key code -8, which cancels). It seems to have something to do with VM_KeyChar().

This is the routine which causes the beep:
Code:
[ MyPause key;
   key = VM_KeyChar();
   if ( key == -4 or -5 or -10 or -11 or -12 or -13 )
   {
      HandleGlkEvent();
   }
   if (key == -8)
   {
      print "^^Cancelled.^";
   }
   return key;
];

EDIT: Cleaned up embarrassingly sloppy code sample.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Jan 14, 2019 11:58 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5921
Quote:
If I RESTART after pressing one of the magic keys (say '1'), then I get the same prompt as before; but this time VM_KeyChar() does not prevent key-presses from showing up at the command line.
I wonder whether this would this be a bug in VM_KeyChar(), or in the actual restart routine?


It doesn't happen in the MacOS IDE, Lectrote, or Gargoyle, so I say it's a WinGlk bug.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jan 15, 2019 4:38 am 
Offline

Joined: Tue Jan 26, 2016 9:35 am
Posts: 67
Ah, I have a Mac in my studio for recording purposes ... I guess I can try to test there. If the sound's not playing there I could write/test on that via Xterm ^^


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jan 15, 2019 8:00 am 
Offline

Joined: Wed Nov 12, 2014 5:20 pm
Posts: 222
My guess is that the beeping has something to do with having a call to VM_KeyChar() immediately follow another call to VM_KeyChar(). But yes, likely a bug in the Windows IDE interpreter.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group