English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 10 January 2023, 14:30   #41
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,442
Thanks Thomas!

I thought that SetMode() was enough, here is what I'm doing:

Code:
static void _enable_RAW_mode(
	BOOL enable)
{
	if(enable)
	{
		// Enable RAW mode
		SetMode(_con_file, 1);
		// Listen to keyboard and close gadget
		printf("\33[1;11{");
	}
	else
	{
		SetMode(_con_file, 0);
	}
}
Should I do something more (and what?) before or after SetMode(_con_file, 0);?

Cheers!
tygre is offline  
Old 10 January 2023, 15:13   #42
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,327
Before, actually. Please turn raw events off again.
Thomas Richter is offline  
Old 10 January 2023, 15:26   #43
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,442
Oh, thank you so much!
That did the trick: now my code also works on AmigaOS v3.2!

For the record, here is the working code:

Code:
static void _enable_RAW_mode(
	BOOL enable)
{
	if(enable)
	{
		// Enable RAW mode
		SetMode(_con_file, 1);
		// Listen to keyboard and close gadget
		printf("\33[1;11{");
	}
	else
	{
		printf("\33[1;11}");
		SetMode(_con_file, 0);
	}
}
Cheers!
tygre is offline  
Old 09 February 2023, 17:36   #44
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,442
Hi there!

I must revive this thread because I just noticed a new problem that I can't explain. When closing AmiModradio, I stop listening to events, re-enable "normal" mode, and release the Console. In particular, I do: printf("\33[1;11}"); to stop listening to keyboard events and the close gadget.

When in ViNCEd, no problem, the Console goes back to its "normal" self: I can close it using EndCLI or the close gadget.

When in an "old" Shell, the Console doesn't go back to its "normal" self: I can close it using EndCLI but not the close gadget. The close gadget doesn't do anything until I press RETURN at least once, then it works as expected.

I can solve this problem by using printf("\33[1}"); instead of printf("\33[1;11}"); but I wonder if I'm missing something that explains the different behaviour between ViNCEd and Shell?

Cheers!

Last edited by tygre; 09 February 2023 at 19:10. Reason: Typos
tygre is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
NewsTek Episode 9 is now available for your listening pleasure. Pyromania Amiga scene 4 26 June 2010 16:42
Listening to Amiga music does this moriez Nostalgia & memories 4 02 April 2010 22:00
listening suggestions Marcuz request.Modules 48 06 August 2008 11:02
NewsTek Episode 2 is now availabe for your listening pleasure. Pyromania Amiga scene 0 21 April 2008 05:44
Amiga Round Table Podcast #17 is available for your listening pleasure! Pyromania Amiga scene 1 18 December 2007 21:22

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:39.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08089 seconds with 14 queries