![]() |
![]() |
#41 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,449
|
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); } } Cheers! |
![]() |
![]() |
#42 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,371
|
Before, actually. Please turn raw events off again.
|
![]() |
![]() |
#43 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,449
|
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); } } |
![]() |
![]() |
#44 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,449
|
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 |
![]() |
![]() |
#45 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,449
|
Hi all!
I'm reviving this thread because I have related questions but for AmigaOS v4.1. I have this piece of code that works well for v3.1 but doesn't for v4.1. It seems to me that the Console doesn't get my choice of raw input events for some reason... Essentially, here is what I do to initialise the Console: Code:
_con_file = Open("CONSOLE:", MODE_OLDFILE) SetMode(_con_file, 1); printf("\33[1;11{"); Code:
memset(&con_standard_packet, 0, sizeof(struct StandardPacket)); con_standard_packet.sp_Msg.mn_Node.ln_Name = (char *)&con_standard_packet.sp_Pkt; con_standard_packet.sp_Pkt.dp_Link = &con_standard_packet.sp_Msg; con_standard_packet.sp_Pkt.dp_Port = _con_reply_port; con_standard_packet.sp_Pkt.dp_Type = ACTION_READ; con_standard_packet.sp_Pkt.dp_Arg1 = _con_file_handle->fh_Arg1; con_standard_packet.sp_Pkt.dp_Arg2 = (LONG)&_con_answer; con_standard_packet.sp_Pkt.dp_Arg3 = (LONG)GLOBALS_MAX_LINE_LENGTH; PutMsg(_con_message_port, &con_standard_packet.sp_Msg); The problem is that, on v3.1, _con_answer will be an input event, but on v4.1, it's the actual pressed key ![]() Thanks in advance! Tygre |
![]() |
Currently Active Users Viewing This Thread: 3 (0 members and 3 guests) | |
Thread Tools | |
![]() |
||||
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 |
|
|