ciao a tutti.
vorrei fare un programmino in java che comandi il mouse e tastiera..avete qualche idea??grazie
ciao a tutti.
vorrei fare un programmino in java che comandi il mouse e tastiera..avete qualche idea??grazie
Vedi java.awt.Robot ma più di quello che ti offre questa classe non puoi fare .... non in Java "puro", almeno.Originariamente inviato da disko
vorrei fare un programmino in java che comandi il mouse e tastiera..avete qualche idea?
Andrea, andbin.dev – Senior Java developer – SCJP 5 (91%) • SCWCD 5 (94%)
java.util.function Interfaces Cheat Sheet — Java Versions Cheat Sheet
ah capito, grazie. potrei fare di più in c ? tanto sono simili come linguaggi
Non è tanto questione di linguaggio .... ma di accesso a funzionalità specifiche del S.O. Gestire mouse/tastiera a livello più "basso" (es. intercettare mouse/tasti a livello globale, sintetizzare pressione di tasti e altro) richiede l'uso di funzioni "native" specifiche del S.O. Ed è chiaro che in C/C++ sfruttare le API "native" del S.O. è una cosa molto normale e più facile.Originariamente inviato da disko
potrei fare di più in c ?
L'unica cosa di vagamente simile è la sintassi .... per il resto C e Java sono due cose completamente diverse.Originariamente inviato da disko
tanto sono simili come linguaggi
Andrea, andbin.dev – Senior Java developer – SCJP 5 (91%) • SCWCD 5 (94%)
java.util.function Interfaces Cheat Sheet — Java Versions Cheat Sheet
capito.
l'altra parte del problema è che dovrei trovare le coordinate di tutti gli elementi che mi interessano(link o campi ) in una pagina web.A questo proposito come potrei fare?
Pagina che hai dove??? Contenuta in un String? In un file? O mica per caso aperta in un browser esterno alla tua applicazione Java (in tal caso c'è ben poco, anzi credo nulla che si possa fare).Originariamente inviato da disko
dovrei trovare le coordinate di tutti gli elementi che mi interessano(link o campi ) in una pagina web.
Andrea, andbin.dev – Senior Java developer – SCJP 5 (91%) • SCWCD 5 (94%)
java.util.function Interfaces Cheat Sheet — Java Versions Cheat Sheet
pagina in un browers web
e se facessi tutto a mano?cioè non c'è nessun programmino che mi da le coordinate finchè sposto fisicamente il mouse?
Quindi tu hai un qualunque browser aperto su una pagina web, e da una tua applicazione Java vorresti "sentire" quando il mouse passa su un link o campi in quella pagina??? No mi spiace, non è sicuramente fattibile.Originariamente inviato da disko
pagina in un browers web
Andrea, andbin.dev – Senior Java developer – SCJP 5 (91%) • SCWCD 5 (94%)
java.util.function Interfaces Cheat Sheet — Java Versions Cheat Sheet
ok ma non posso nemmeno passare la pagina fisicamente e poi memorizzare quello che mi serve in un log? tipo ho trovato questo:
<!--
================================================== ==========
Capturing The Mouse Position in IE4-6 & NS4-6
(C) 2000 www.CodeLifter.com
Free for all users, but leave in this header
//-->
<html>
<body>
<!-- Part One:
Set up a form named "Show" with text fields named "MouseX"
and "MouseY". Note in the getMouseXY() function how fields
are addressed, thus: document.FormName.FieldName.value
//-->
<form name="Show">
<input type="text" name="MouseX" value="0" size="4"> X
<input type="text" name="MouseY" value="0" size="4"> Y
</form>
<!-- Part Two:
Use JavaScript ver 1.2 so older browsers ignore the script.
The <script> must be *after* the <form> -- since the form
and fields must exist *prior* to being called in the script.
//-->
<script language="JavaScript1.2">
<!--
// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false
// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)
// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;
// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0
// Main function to retrieve mouse x-y pos.s
function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
} else { // grab the x-y pos.s if browser is NS
tempX = e.pageX
tempY = e.pageY
}
// catch possible negative values in NS4
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
// show the position values in the form named Show
// in the text fields named MouseX and MouseY
document.Show.MouseX.value = tempX
document.Show.MouseY.value = tempY
return true
}
//-->
</script>
</body>
</html>
se potessi incollarlo alla pagina salvata sarebbe tutto risolto ma nn so se e come fare