Why do you want such an event?

The walls are defined by two points. That is point (0,0) and and point (battleFieldWidth, battleFieldHeight).

You can use the two methods getBattleFieldWidth() and getBattleFieldHeight() to get the battle field size.

Actually it is possible to create your own Condition for firing a Custom Event in Robocode. This way you are able to create your own event for detection the wall, and also tell which walls that have been detected.

Here I give you a complete robot showing how to do that:

package example;
import robocode.*;

public class WallDetectionRobot extends AdvancedRobot {
    public void run() {

       // Add our WallDetectedCondition as a custom event
        addCustomEvent(new WallDetectedCondition());

        while(true) {
            ahead(100);
            turnGunRight(360);
            back(100);
            turnGunRight(360);
        }
    }

    public void onScannedRobot(ScannedRobotEvent e) {
        fire(1);
    }

    public void onCustomEvent(CustomEvent e) {
        WallDetectedCondition wdc = (WallDetectedCondition) e.getCondition();
        if (wdc.detectedLeftWall) {
            out.println("Left wall detected");
        }
        if (wdc.detectedButtomWall) {
            out.println("Buttom wall detected");
        }
        if (wdc.detectedRightWall) {
            out.println("Right wall detected");
        }
        if (wdc.detectedTopWall) {
            out.println("Top wall detected");
        }
    }

    class WallDetectedCondition extends Condition {

        public boolean detectedLeftWall;
        public boolean detectedButtomWall;
        public boolean detectedRightWall;
        public boolean detectedTopWall;

        public boolean test() {
            detectedLeftWall = getX() < Rules.RADAR_SCAN_RADIUS;
            detectedButtomWall = getY() < Rules.RADAR_SCAN_RADIUS;
            detectedRightWall = (getBattleFieldWidth() - getX()) < Rules.RADAR_SCAN_RADIUS;
            detectedTopWall = (getBattleFieldHeight() - getY()) < Rules.RADAR_SCAN_RADIUS;

            return detectedLeftWall || detectedButtomWall || detectedRightWall || detectedTopWall;
    }
}