English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 25 June 2015, 15:28   #1
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Key logger Commodity with Source Code?

I am not trying to use this for wrong reasons. I would like to create a commodity myself but to be honest I do not know from where to start with C Amiga development.

I would like that when I start typing in Workbench and hit enter a program us run. For example if I wrote "WordWorth" the Commodity would start WordWorth7. If I type "Colonization" then it would run the game "Colonization".

I am not sure if something like this exists for the Workbench. This would mean no need of opening several folders or have a menu.
Sim085 is offline  
Old 25 June 2015, 16:40   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,020
You should consider that a commoditiy sits in the input stream. It is not specific to an active application and AFAIK it cannot determine which application is active.

Therefore your commodity will run Wordworth not only when Workbench is active but also if you open a text editor and write "I like WordWorth as a word processor" into it.

Anyway, find attached an example of a standard commodity, i.e. it just listens for a hotkey and opens its GUI.
Attached Files
File Type: c commo.c (8.6 KB, 77 views)
thomas is offline  
Old 25 June 2015, 21:24   #3
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Thanks for the code thomas . I'll try to compile it.

Quote:
Originally Posted by thomas View Post
Anyway, find attached an example of a standard commodity, i.e. it just listens for a hotkey and opens its GUI.
You are right. Also if I am in a text editor and I want to run Paint I would be actually be typing "paint" in the text document even if I just wanted to run paint .

Quote:
Originally Posted by thomas View Post
You should consider that a commoditiy sits in the input stream. It is not specific to an active application and AFAIK it cannot determine which application is active.

Therefore your commodity will run Wordworth not only when Workbench is active but also if you open a text editor and write "I like WordWorth as a word processor" into it.
Sim085 is offline  
Old 25 June 2015, 21:50   #4
jimbob
Registered User
 
Join Date: May 2006
Location: Kilmacolm
Age: 46
Posts: 632
Can you set a bunch of aliases for the programs you want a keyboard shortcut to run? Then you could just type Amiga+e (not sure if it is left or right amiga) to get a single command entry window then enter your shortcut name.
jimbob is offline  
Old 25 June 2015, 23:06   #5
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
What I am thinking is that the Amiga key would start another program (therefore taking focus) what you write is captured by this second program. When you hit enter the program tries to map the input with a program and tries to start that and exit (or simply no longer taking input). Like that if you are writing a document the program that you write does not finish written in the document.

Unfortunately I do not have much experience with Amiga development and therefore I am not sure how much of the above is possible or not.

Quote:
Originally Posted by jimbob View Post
Can you set a bunch of aliases for the programs you want a keyboard shortcut to run? Then you could just type Amiga+e (not sure if it is left or right amiga) to get a single command entry window then enter your shortcut name.
Sim085 is offline  
Old 28 June 2015, 15:33   #6
jimbob
Registered User
 
Join Date: May 2006
Location: Kilmacolm
Age: 46
Posts: 632
That's kinda what Amiga+E does. Opens a window for entering a single command. Combined with the ALIAS command you can get what you want I think, no programming required.

For example, Classic WB has personal paint installed. The programs path is -

sys:Programs/ppaint/ppaint

I can add the line

ALIAS paint sys:Programs/ppaint/ppaint

to the file

S:User-Startup

Now pressing "right Amiga+e" and entering "paint" in the window will load ppaint.
jimbob is offline  
Old 28 June 2015, 16:59   #7
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,020
Just for fun I completed the above example into a full project.

Now it sits in the background until you press the hotkey (Ctrl-R). Then it opens a list of predefined programs. You can choose one with the cursor keys or by entering a few letters into the input field. Press enter to run the program or Esc to hide the window.

The list of programs is configured as tooltypes in the commodity's icon. The format is TOOL=name,path where name is shown in the list and path is the command to run. For example TOOL=Multiview,Sys:Utilities/Multiview
Attached Files
File Type: lha commo.lha (30.0 KB, 88 views)
thomas is offline  
Old 30 June 2015, 12:21   #8
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
I had not seen this. Thanks thomas I'll go an try it as soon as I am home.

Quote:
Originally Posted by thomas View Post
Just for fun I completed the above example into a full project.
Sim085 is offline  
Old 04 July 2015, 17:44   #9
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
That looks great. Just a question, what tool do you use to compile it?

Quote:
Originally Posted by thomas View Post
Just for fun I completed the above example into a full project.
Sim085 is offline  
Old 04 July 2015, 18:43   #10
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,020
Unpack this to somewhere on your harddrive:
http://www.haage-partner.de/download/AmigaOS/NDK39.lha

Unpack these to ram: and install vbcc_bin first, then vbcc_target. When asked for the include directory select NDK_3.9/include/include_h from the archive above.
http://server.owl.de/~frank/vbcc/201...amigaos68k.lha
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha

Unpack this to ram: and copy ixemul-020s.library to libs:ixemul.library
http://aminet.net/dev/lib/ixemul-48.3-bin-m68k.lha

Unpack this to ram: and copy make to c:
http://aminet.net/dev/gg/make-382-bin-m68k.lha

Reboot. Then open a shell window, change to the commo directory and just enter make.
thomas is offline  
Old 06 July 2015, 01:09   #11
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Thanks thomas, managed to install. I was getting the following error when trying to create executable.

Code:
Fatal error 8: Cannot open "-ldebug": No such file or directory.
I guess this is because I have some missing library. To create executable I therefore removed "-ldebug" from makefile line "LIBS = -lamiga -lauto -ldebug" and ran command "make all"


Quote:
Originally Posted by thomas View Post
Unpack this to somewhere on your harddrive:
...

Last edited by Sim085; 06 July 2015 at 11:14.
Sim085 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
My old source code gemanix Coders. General 36 09 July 2017 13:33
Needed: A simple commodity that deletes files on workbench when you press the DEL key gulliver support.Apps 20 27 February 2015 19:01
Source Code camelord support.Games 2 06 August 2010 17:45
Source Code Thalion project.WinUAE - Kaillera 3 28 April 2006 09:55

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 18:29.

Top

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