]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/src/terminal_interface-curses-mouse.adb
ncurses 5.7 - patch 20090328
[ncurses.git] / Ada95 / src / terminal_interface-curses-mouse.adb
index 8a7499ac31658eb64f5a6f036c200f4ac7dd1995..1fce1dc88a70d6965df9b7ef49665781cdf5f8f6 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
 -- sale, use or other dealings in this Software without prior written       --
 -- authorization.                                                           --
 ------------------------------------------------------------------------------
---  Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1996
+--  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.16 $
+--  $Revision: 1.23 $
+--  $Date: 2008/11/16 00:19:59 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
-with System;
-
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
 with Interfaces.C; use Interfaces.C;
 use Interfaces;
@@ -47,12 +46,11 @@ use Interfaces;
 package body Terminal_Interface.Curses.Mouse is
 
    use type System.Bit_Order;
-   use type Interfaces.C.int;
 
    function Has_Mouse return Boolean
    is
       function Mouse_Avail return C_Int;
-      pragma Import (C, Mouse_Avail, "_nc_has_mouse");
+      pragma Import (C, Mouse_Avail, "has_mouse");
    begin
       if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then
          return True;
@@ -116,13 +114,18 @@ package body Terminal_Interface.Curses.Mouse is
       Old : aliased Event_Mask;
    begin
       R := MMask (Mask, Old'Access);
+      if R = No_Events then
+         Beep;
+      end if;
       return Old;
    end Start_Mouse;
 
    procedure End_Mouse (Mask : in Event_Mask := No_Events)
    is
    begin
-      null;
+      if Mask /= No_Events then
+         Beep;
+      end if;
    end End_Mouse;
 
    procedure Dispatch_Event (Mask   : in  Event_Mask;