Commit 29378aaf authored by ASCP's avatar ASCP 💬

Initial commit

parents
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [2.5.1] - 2018-05-05
### Added
- README, CHANGELOG
- git versioning
### Changed
- Project structure cleanup
- 1TouchMac -> OneTouchMac
- COPYING -> LICENSE.md
- OneTouchMAC to OneTouchMac
This diff is collapsed.
# OneTouchMac
**Description**: Multi startup-sequence boot using mouse buttons. It's a simple program that allow you to boot from different Startup-sequence
files by Pressing the left, the right or the middle mouse button (a different file will be executed depending on witch button you've pressed).
It's totaly tranparent, unlike thoses softs that display a menu or something else. it means that your Amiga always boot as fast as possible: if no mouse
button is pressed, the original startup-sequence file is launghed, and if you press a mouse button, a different startup-sequence is executed (instead of the original one) automagicaly without any other click !
- **Technology stack**: C, MUI 3.8
- **Status**: [CHANGELOG](https://gitlab.com/amigasourcecodepreservation/onetouchmac/blob/master/CHANGELOG.md).
**Screenshot**:
![TO-DO](TO-DO)
## Dependencies
* Amiga OS Classic
* MUI 3.8
* TO-DO...
## Installation
Detailed instructions on how to install, configure, and get the project running.
TO-DO
## Configuration
TO-DO
## Usage
Examples:
> I use it to boot MacOS via Shapeshifter in " quick mode " without loading the WB or booting with "no startup sequence". By this way, the MacOS boot like i I had a real Mac :) I use it also to boot linux PPC directly wothout starting the workbench, thus it look like a real OS that boot without the help of another OS !
> But don't be afraid, you can boot other things than Shapeshifter or Linux PPC, it's just an exemple ! You can do for example, different startup file to boot on other hardrive, or to boot a light version of your startup-sequence to gain memory for games or something else..
## How to test the software
TO-DO
## Known issues
TO-DO
## Getting help
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.
## Getting involved
Contact your old amiga friends and tell them about our project, and ask them to dig out their source code or floppies and send them to us for preservation.
Clean up our hosted archives, and make the source code buildable with standard compilers like devpac, asmone, gcc 2.9x/Beppo 6.x, sas/c ,vbcc and friends.
Cheers!
Twitter
https://twitter.com/AmigaSourcePres
Gitlab
WWW
https://amigasourcepres.gitlab.io/
_____ ___ _ __ __ _ __ __ ___ ___ _
|_ _| __| /_\ | \/ | /_\ | \/ |_ _/ __| /_\
| | | _| / _ \| |\/| | / _ \| |\/| || | (_ |/ _ \
_|_| |___/_/ \_\_|_ |_|_/_/_\_\_|__|_|___\___/_/_\_\
/ __|/ _ \| | | | _ \/ __| __| / __/ _ \| \| __|
\__ \ (_) | |_| | / (__| _| | (_| (_) | |) | _|
|___/\___/_\___/|_|_\\___|___|__\___\___/|___/|___|_
| _ \ _ \ __/ __| __| _ \ \ / /_\_ _|_ _/ _ \| \| |
| _/ / _|\__ \ _|| /\ V / _ \| | | | (_) | .` |
|_| |_|_\___|___/___|_|_\ \_/_/ \_\_| |___\___/|_|\_|
----
## Open source licensing info
OneTouchMac is distributed under the terms of the GNU General Public License, version 2 or later. See the [LICENSE](https://gitlab.com/amigasourcecodepreservation/onetouchmac) file for details.
----
## Credits and references
Many thanks to Julien Tiphaine for releasing the source code under GPL.
@DATABASE OneTouchMac.guide
@REMARK Edited with Guided by Linus McCabe
@NODE "Main" "Main"
Well, I know that reading Doc is boring, but please, read it,
it's really short ! :)
If you have any problems or suggestions, E-Mail me at:
sebju@club-internet.fr
@{"What's OneTouchMac ?" link What }
@{"Why this Name ? " link Why }
@{"How to Install it ? " link Install} @{B}VERY IMPORTANT !!!@{UB}
@{"Legal Things " link Legal } @{B}Must Read it ANYWAYS@{UB}
@ENDNODE
@NODE "What" "What"
@{B}What's OneTouchMac ?@{UB}
This a simple program witch allows you to boot from another startup-sequence
by pressing the left, right or middle mouse button.
You can execute 3 differents startups, depending on witch mouse button you press.
If you press a mouse button, the REAL STARTUP-SEQUENCE Will Stop Loading.
@{B}NOTE THAT THIS PROGRAM ONLY WORK WITH MOUSE CONNECTED TO THE ORIGINAL@{UB}
@{B}AMIGA MOUSE PORT @{UB}
@ENDNODE
@NODE "Why" "Why"
@{B}Why This name ?@{UB}
I made this little program to boot the MacOS via shapeshifter in "Quick
mode" without loading the workbench or typing commands after a boot with
"no startup-sequence". By this way I can boot MacOS with all the ressources
and directly on the boot, near a real MAc. So I called it OneTouchMac ! :)
But don't be affraid, you can of course boot other startup and softs...
@ENDNODE
@NODE "Install" "Install"
@{B}INSTALATION: VERY EASY !@{UB}
before using OneTouchMac, you must run the "install" script or copy the files "gui" ,
"GUI4CLI", "OneTouchMac" and "OneTouchMac.gc in your "C" directory
There's to way to insert the command in the startup sequence. A simple one, and a...
less simple one. :)
- @{U}Install via the OneTouchMac Pref program@{UU}
Well it's quite easy, just select the file you want with one of
the three "get" buttons (a requester will appear).
For exemple, if you want to assign a startup to the left mouse button, clik on the "get"
button witch is on the submenu "Left Mouse Button".
Then click "Install" button (or select other file for other button). Now, when you will reboot,
if you press the left Mouse button (keep it pushed until your file is launched) the
file you've selected will be executed (and startup-sequence will be alted). Else, your
startup-sequence will be executed normaly.
If you want to Remove the OneTouchMac program from your startup-sequence, just
press the "remove" button in OneTouchMac pref. Other way, if you want to fully uninstall
OneTouchMac (that's to say to delete ALL OneTouchMac related files) use the Uninstall
script. This one will delete all things about OneTouchMac and will restore your initial
startup-sequence.
- @{U}Install Manually:@{UU}
In the first line of your startup-sequence (before "c:Setpatch") you must
type "FailAt 1".
just under this line (also before "c:setpatch") type your command. that is to say:
@{I}FailAt 1@{UI}
@{I} OneTouchMac <LMB or MMB or RMB> <your startup file>@{UI}
you can enter 3 startup files, exemple :
@{I}OneTouchMac LMB Startup1 MMB Startup2 RMB startup3@{UI}
In this exemple, when you will boot, if you press the left Mouse button, the file "Startup1"
will be executed. If you press the Middle Mouse button, the file "startup2" will be executed, etc...
You can enter theses arguments in diferent position, exemple :
@{I}OneTouchMAc RMB Startup3 MMB Startup1@{UI}
That's all. Don't forget to enter the full path of each files, or use the pref program, it's better.
@ENDNODE
@NODE "Legal" "Legal"
@{B}LEGAL THINGS:@{UB}
OneTouchMac is distributed under the terms of the GNU General Public License, version 2 or later. See the LICENSE.md file for details.
@ENDNODE
Short: Boot others startup files with mouse buttons
Author: sebju@club-internet.fr
Uploader: sebju@club-internet.fr
Type: util/boot
Requierment :
- An Amiga with an hard drive (this program is not very usefull without an
hardrive !)
- MUI 3.8 is needed for the prefs program (not tested on earlier versions)
- the main program should work on any version of the Workbench (tested only on 3.x)
Description:
It's a simple program that allow you to boot from others Startup-sequence files
by Pressing the left, the right or the middle mouse button (a different file will be
executed depending on witch button you've pressed).
I use it to boot MacOS via Shapeshifter in " quick mode " without loading the WB or booting with
"no startup sequence". By this way, the MacOS boot like if I had a real Mac :) But don't be affraid,
you can boot other things than Shapeshifter, it's just an exemple !
It's the fastest and easiest way to boot different Startup Files directly, without going in a
menu or something else.
Read the guide for more details and to Install it (VERY EASY you'll See !)
Historic :
- V 1.0 : first version of OneTouchMac.
- V 1.1 : A big bug as been removed : it was impossible to use the right mouse button
- V 2.0 : - Support for middle Mouse button added
- a GUI Pref program added for easy setup and correctly insertion of the command
syntax (all is automatic, you just have to choose witch file has to be assigned
to witch mouse button)
- Install and Uninstall scripts fully functionals added
- The Sources are no longer distributed with this archive, because I don't think
that it's very interesting. Mail me if you want it...
- V 2.5 : - Main program rewritted. it's smaller (6.8 kb instead of 12 kb)
- The GUI Prefs Program is now in MUI and it's a lot reliable and bugfree:
You will never see again the OneTouchMac command 2 times in your Startup-sequence
if you don't use correctly the Prefs program.
- Installation is done via the Installer
Short: OneTouchMac source code
Uploader: amigasourcecodepreservation@gmail.com
Author: Julien Tiphaine
Type: util/boot
Version: 2.5
Architecture: generic
Source code for the boot handler OneTouchMac.
Binaries: http://aminet.net/package/util/boot/1TouchMac25
Uploaded to aminet for historical preservation.
Many thanks to Julien Tiphaine for releasing the code.
License
=======
OneTouchMac is distributed under the terms of the GNU General Public License,
version 2 or later. See the COPYING file for details.
Cheers!
https://twitter.com/AmigaSourcePres
_____ ___ _ __ __ _ __ __ ___ ___ _
|_ _| __| /_\ | \/ | /_\ | \/ |_ _/ __| /_\
| | | _| / _ \| |\/| | / _ \| |\/| || | (_ |/ _ \
_|_| |___/_/ \_\_|_ |_|_/_/_\_\_|__|_|___\___/_/_\_\
/ __|/ _ \| | | | _ \/ __| __| / __/ _ \| \| __|
\__ \ (_) | |_| | / (__| _| | (_| (_) | |) | _|
|___/\___/_\___/|_|_\\___|___|__\___\___/|___/|___|_
| _ \ _ \ __/ __| __| _ \ \ / /_\_ _|_ _/ _ \| \| |
| _/ / _|\__ \ _|| /\ V / _ \| | | | (_) | .` |
|_| |_|_\___|___/___|_|_\ \_/_/ \_\_| |___\___/|_|\_|
; OneTouchMAc Installer Script
(copyfiles
(prompt "copy the OneTouchMac Command in your C drawer")
(help "don't move OneTouchMac command from your C drawer or it will not work")
(source "files/OneTouchMac")
(dest "C:")
(confirm)
)
(set Prefs_Target
( askdir
(prompt "Where do you want to copy the prefs program ?")
(help "it will copy OneTouchMac_Prefs into the directory you'll choose")
(default "Sys:Prefs")
(newpath)
)
)
(copyfiles
(prompt "Copy Prefs program to @Prefs_Target")
(Source "files/OneTouchMac_Prefs")
(dest Prefs_Target)
(confirm)
)
/*
* This file is part of OneTouchMac.
* Copyright (C) 2000 Julien Tiphaine
*
* OneTouchMac is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OneTouchMac is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OneTouchMac. If not, see <http://www.gnu.org/licenses/>.
*
*/
// program:OneTouchMac V2.5
// Author:TIPHAINE Julien
// Last updated the: 23/04/2000
// Description: Alow to execute a diferent startup-sequence, given in argument,
// by pressing LMB RMB or MMB.This prog ONLY WORK WITH AMIGA MOUSE PORT
#include <stdio.h>
#include <string.h>
#include <exec/types.h>
#include <hardware/custom.h>
#include <hardware/cia.h>
#define LEFT_BUTTON 1
#define MIDDLE_BUTTON 2
#define RIGHT_BUTTON 4
#define PORT1 1
const char *Version="$VER: OneTouchMac Version 2.6";
// link to ROM structures: always defined by the System //
extern struct Custom custom;
extern struct CIA ciaa;
int main(int argc, char **argv)
{
// Vars //
UBYTE Mouse(UBYTE port);
char Commande[207]= "execute ";
int I,Val=0;
int LMBRang=0,MMBRang=0,RMBRang=0;
/* Check if any arguments have been typed */
if (argc < 2)
{ printf("Syntaxe is: OneTouchMac <LMB|MMB|RMB> <Startup File 1> [<LMB|MMB|RMB>] [<Startup File 2>] [<LMB|MMB|RMB>] [<Startup File 3>] ");
printf("\nTry Again ! :)\n");
exit(0);
}
/* Check For LMB/RMB/MMB in argv in order to know witch startup have to */
/* be assigned to which mouse button */
for (I=1;I<argc;I++)
{ if (strcmp (argv[I],"LMB")==0 && argv[I+1]!=NULL && LMBRang==0)
LMBRang=I+1;
if (strcmp (argv[I],"MMB")==0 && argv[I+1]!=NULL && MMBRang==0)
MMBRang=I+1;
if (strcmp (argv[I],"RMB")==0 && argv[I+1]!=NULL && RMBRang==0)
RMBRang=I+1;
}
/* Check if arguments have been typed correctly */
if (LMBRang==0 && RMBRang==0 && MMBRang==0)
{ printf("No startup file found ! Check that you have type LMB, RMB or MMB in upper case and that you've entered a file, or use OnetouchMac Pref to setup correctly.\n");
exit(0);
}
/* get the Mouse button which is pressed */
switch(Mouse (PORT1))
{ case LEFT_BUTTON: if (LMBRang !=0)
{ strcat(Commande, argv[LMBRang]);
system(Commande);
}
Val=20;
break;
case RIGHT_BUTTON: if (RMBRang !=0)
{ strcat(Commande, argv[RMBRang]);
system(Commande);
}
Val=20;
break;
case MIDDLE_BUTTON: if (MMBRang !=0)
{ strcat(Commande, argv[MMBRang]);
system(Commande);
}
Val=20;
break;
}
return Val;
}
/***************** Mouse Function ********************/
/* Return values 1,2 or 4 if left, Middle or Right */
/* Mouse button have been pressed. */
/* It's not a clear code, but as I need Mousse */
/* message while no windows are opened I don't know */
/* how to do by another way. */
/* This function come from Amiga C encyclopedia */
/*****************************************************/
UBYTE Mouse(UBYTE port)
{
UBYTE data = 0;
UWORD joy, pot;
custom.potgo = 0xFF00;
pot = custom.potinp;
joy = custom.joy0dat;
data += !( ciaa.ciapra & 0x0040 ) ? LEFT_BUTTON : 0;
data += !( pot & 0x0100 ) ? MIDDLE_BUTTON : 0;
data += !( pot & 0x0400 ) ? RIGHT_BUTTON : 0;
return( data );
}
/*
* This file is part of OneTouchMac.
* Copyright (C) 2000 Julien Tiphaine
*
* OneTouchMac is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OneTouchMac is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OneTouchMac. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "OneTouchMacIO.h"
/*********** function to copy files **************/
BOOL CopyFile (char Source[], char Dest[])
{ // vars //
FILE *F_Source=NULL,*F_Dest=NULL;
char *buf=NULL;
FileInfoBlock *fib=NULL;
BPTR mylock=0;
BOOL OK=TRUE;
// lock file and get file infos //
mylock=Lock(Source,ACCESS_READ);
fib=AllocMem(sizeof(struct FileInfoBlock),0);
if (mylock!=0 && fib!=0)
{ Examine(mylock,fib);
UnLock(mylock); // unlock file as we have finish getting infos
buf=AllocMem(fib->fib_Size,MEMF_CLEAR); // we do a buffer with the file's size
}
else OK=FALSE;
// here we copy the file //
if ((F_Source=fopen(Source,"r")) && (F_Dest=fopen(Dest,"a")))
{ fread(buf,fib->fib_Size,1,F_Source);
fprintf(F_Dest,"%s",buf);
// freeing ressources //
fclose(F_Source);
fclose(F_Dest);
}
else OK=FALSE;
if(buf) FreeMem(buf,fib->fib_Size);
if(fib) FreeMem(fib, sizeof(struct FileInfoBlock));
return OK;
}
/**************** Save function ******************/
BOOL Save(char *LStartup, char *MStartup, char *RStartup)
{
// vars //
FILE *MonFich=NULL,*cfg=NULL ;
char sep_haut[]=";******************** Added by OneTouchMac ********************\n";
char cmd[200] =" OneTouchMac";
char sep_bas[] ="\n;********************* End of OneTouchMac *********************\n";
int I=0;
prefs head[3];
BOOL OK=FALSE;
BOOL rem();
// we delete file created before in order not to write OneTouchMac commande two times //
rem();
// create the new Startup-sequence file in RAM://
MonFich=fopen("RAM:startup-sequence", "w");
cfg=fopen("S:OneTouchMac.cfg", "w");
if (MonFich && cfg)
{ // write things that are always written //
fwrite (sep_haut, strlen(sep_haut),1,MonFich);
// tests wich arguments to put //
if (strlen(LStartup)>0)
{ strcat(cmd, " LMB ");
strcat(cmd, LStartup);
head[I].Taille = strlen(LStartup);
strcpy(head[I].BT,"LMB");
fwrite(&head[I],sizeof(prefs),1,cfg);
fwrite(LStartup,strlen(LStartup),1,cfg);
I++;
}
if (strlen(MStartup)>0)
{ strcat(cmd, " MMB ");
strcat(cmd, MStartup);
head[I].Taille = strlen(MStartup);
strcpy(head[I].BT,"MMB");
fwrite(&head[I],sizeof(prefs),1,cfg);
fwrite(MStartup,strlen(MStartup),1,cfg);
I++;
}
if (strlen(RStartup)>0)
{ strcat(cmd, " RMB ");
strcat(cmd, RStartup);
head[I].Taille = strlen(RStartup);
strcpy(head[I].BT,"RMB");
fwrite(&head[I],sizeof(prefs),1,cfg);
fwrite(RStartup,strlen(RStartup),1,cfg);
}
// close config file //
fclose(cfg);
// all argument we want are ready, now we finish writting //
fwrite(cmd, strlen(cmd),1,MonFich);
fwrite(sep_bas, strlen(sep_bas),1,MonFich);
fclose(MonFich);
if(CopyFile("S:Startup-sequence","Ram:Startup-sequence")) // append Startup-sequence to our's in Ram:
if(Rename("S:Startup-sequence", "S:Startup-sequence.bak")) // We make a backup os user's startup
if(CopyFile("Ram:Startup-sequence","S:Startup-sequence"))// we replace user's original startup file
OK=TRUE;
}
DeleteFile("Ram:Startup-sequence");
return OK;
}
/************** function Rem **************/
BOOL rem()
{ BOOL OK=FALSE;
DeleteFile("S:OneTouchMac.cfg");
Rename("S:Startup-sequence","S:Startup-sequence.OTM");
// we must find Startup-sequence.bak before deleting S:startup-sequence //
if(Rename("S:Startup-sequence.bak","S:Startup-sequence"))
{ DeleteFile("S:Startup-sequence.OTM");
OK=TRUE;
}
else
Rename("S:Startup-sequence.OTM","S:Startup-sequence");// if no backup found, we restore startup-sequence
return OK;
}
/*
* This file is part of OneTouchMac.
* Copyright (C) 2000 Julien Tiphaine
*
* OneTouchMac is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OneTouchMac is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OneTouchMac. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ONETOUCHMACIO_H
#define ONETOUCHMACIO_H
// Standart C include //
#include <stdio.h>
#include <string.h>
// Amiga Include //
#include <dos/dos.h>
#include <exec/exec.h>
// protos include //
#include <proto/exec.h>
#include <clib/dos_protos.h>
#include <pragmas/dos_pragmas.h>
/************** Struct of config file *************/
struct prefs { int Taille;
char BT[4];
};
BOOL CopyFile (char *,char *);
BOOL Save(char *,char *, char *);
BOOL rem();
#endif
/*
* This file is part of OneTouchMac.
* Copyright (C) 2000 Julien Tiphaine
*
* OneTouchMac is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OneTouchMac is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OneTouchMac. If not, see <http://www.gnu.org/licenses/>.
*
*/
// program:OneTouchMac V2.5
// Author:TIPHAINE Julien
// Last updated the: 23/04/2000
// Description: Alow to execute a diferent startup-sequence, given in argument,
// by pressing LMB RMB or MMB.This prog ONLY WORK WITH AMIGA MOUSE PORT
#include <stdio.h>
#include <string.h>
#include <exec/types.h>
#include <hardware/custom.h>
#include <hardware/cia.h>
#define LEFT_BUTTON 1
#define MIDDLE_BUTTON 2
#define RIGHT_BUTTON 4
#define PORT1 1
const char *Version="$VER: OneTouchMac Version 2.5";
// link to ROM structures: always defined by the System //
extern struct Custom custom;
extern struct CIA ciaa;
int main(int argc, char **argv)
{
// Vars //
UBYTE Mouse(UBYTE port);
char Commande[207]= "execute ";
int I,Val=0;
int LMBRang=0,MMBRang=0,RMBRang=0;
/* Check if any arguments have been typed */
if (argc < 2)
{ printf("Syntaxe is: OneTouchMac <LMB|MMB|RMB> <Startup File 1> [<LMB|MMB|RMB>] [<Startup File 2>] [<LMB|MMB|RMB>] [<Startup File 3>] ");
printf("\nTry Again ! :)\n");
exit(0);
}
/* Check For LMB/RMB/MMB in argv in order to know witch startup have to */
/* be assigned to which mouse button */
for (I=1;I<argc;I++)
{ if (strcmp (argv[I],"LMB")==0 && argv[I+1]!=NULL && LMBRang==0)
LMBRang=I+1;
if (strcmp (argv[I],"MMB")==0 && argv[I+1]!=NULL && MMBRang==0)
MMBRang=I+1;
if (strcmp (argv[I],"RMB")==0 && argv[I+1]!=NULL && RMBRang==0)
RMBRang=I+1;
}
/* Check if arguments have been typed correctly */
if (LMBRang==0 && RMBRang==0 && MMBRang==0)
{ printf("No startup file found ! Check that you have type LMB, RMB or MMB in upper case and that you've entered a file, or use OnetouchMac Pref to setup correctly.\n");
exit(0);
}
/* get the Mouse button which is pressed */
switch(Mouse (PORT1))
{ case LEFT_BUTTON: if (LMBRang !=0)
{ strcat(Commande, argv[LMBRang]);
system(Commande);
}
Val=20;
break;
case RIGHT_BUTTON: if (RMBRang !=0)
{ strcat(Commande, argv[RMBRang]);
system(Commande);
}
Val=20;
break;
case MIDDLE_BUTTON: if (MMBRang !=0)
{ strcat(Commande, argv[MMBRang]);
system(Commande);
}
Val=20;
break;
}
return Val;
}
/***************** Mouse Function ********************/
/* Return values 1,2 or 4 if left, Middle or Right */
/* Mouse button have been pressed. */
/* It's not a clear code, but as I need Mousse */
/* message while no windows are opened I don't know */
/* how to do by another way. */
/* This function come from Amiga C encyclopedia */
/*****************************************************/
UBYTE Mouse(UBYTE port)
{
UBYTE data = 0;
UWORD joy, pot;
custom.potgo = 0xFF00;
pot = custom.potinp;
joy = custom.joy0dat;